@@ -60,20 +60,14 @@ struct Command<'self> {
60
60
usage_full : UsageSource < ' self > ,
61
61
}
62
62
63
- static NUM_OF_COMMANDS : uint = 7 ;
64
-
65
- // FIXME(#7617): should just be &'static [Command<'static>]
66
- // but mac os doesn't seem to like that and tries to loop
67
- // past the end of COMMANDS in usage thus passing garbage
68
- // to str::repeat and eventually malloc and crashing.
69
- static COMMANDS : [ Command < ' static > , .. NUM_OF_COMMANDS ] = [
70
- Command {
63
+ static COMMANDS : & ' static [ Command < ' static > ] = & ' static [
64
+ Command {
71
65
cmd : "build" ,
72
66
action : CallMain ( "rustc" , rustc:: main_args) ,
73
67
usage_line : "compile rust source files" ,
74
68
usage_full : UsgCall ( rustc_help) ,
75
69
} ,
76
- Command {
70
+ Command {
77
71
cmd : "run" ,
78
72
action : Call ( cmd_run) ,
79
73
usage_line : "build an executable, and run it" ,
@@ -83,7 +77,7 @@ static COMMANDS: [Command<'static>, .. NUM_OF_COMMANDS] = [
83
77
\n \n Usage:\t rust run <filename> [<arguments>...]"
84
78
)
85
79
} ,
86
- Command {
80
+ Command {
87
81
cmd : "test" ,
88
82
action : Call ( cmd_test) ,
89
83
usage_line : "build a test executable, and run it" ,
@@ -93,25 +87,25 @@ static COMMANDS: [Command<'static>, .. NUM_OF_COMMANDS] = [
93
87
./<filestem>test~\" \n \n Usage:\t rust test <filename>"
94
88
)
95
89
} ,
96
- Command {
90
+ Command {
97
91
cmd : "doc" ,
98
92
action : CallMain ( "rustdoc" , rustdoc:: main_args) ,
99
93
usage_line : "generate documentation from doc comments" ,
100
94
usage_full : UsgCall ( rustdoc:: config:: usage) ,
101
95
} ,
102
- Command {
96
+ Command {
103
97
cmd : "pkg" ,
104
98
action : CallMain ( "rustpkg" , rustpkg:: main_args) ,
105
99
usage_line : "download, build, install rust packages" ,
106
100
usage_full : UsgCall ( rustpkg:: usage:: general) ,
107
101
} ,
108
- Command {
102
+ Command {
109
103
cmd : "sketch" ,
110
104
action : CallMain ( "rusti" , rusti:: main_args) ,
111
105
usage_line : "run a rust interpreter" ,
112
106
usage_full : UsgStr ( "\n Usage:\t rusti" ) ,
113
107
} ,
114
- Command {
108
+ Command {
115
109
cmd : "help" ,
116
110
action : Call ( cmd_help) ,
117
111
usage_line : "show detailed usage of a command" ,
0 commit comments