@@ -10,84 +10,84 @@ pub fn build_cli() -> App<'static, 'static> {
1010 . subcommand ( SubCommand :: with_name ( "courses" ) . about ( "List the available courses" ) )
1111 . subcommand (
1212 SubCommand :: with_name ( "download" )
13- . about ( "Downloads course exercises" )
14- . arg (
15- Arg :: with_name ( "course" )
16- . short ( "c" )
17- . long ( "course" )
18- . value_name ( "course name" )
19- . required ( false ) ,
13+ . about ( "Downloads course exercises" )
14+ . arg (
15+ Arg :: with_name ( "course" )
16+ . short ( "c" )
17+ . long ( "course" )
18+ . value_name ( "course name" )
19+ . required ( false ) ,
2020 )
21- . arg (
22- Arg :: with_name ( "currentdir" )
23- . short ( "d" )
24- . long ( "currentdir" )
25- . required ( false ) ,
21+ . arg (
22+ Arg :: with_name ( "currentdir" )
23+ . short ( "d" )
24+ . long ( "currentdir" )
25+ . required ( false ) ,
2626 ) ,
27- )
27+ )
2828 . subcommand (
2929 SubCommand :: with_name ( "exercises" )
30- . about ( "List the exercises for a specific course" )
31- . arg ( Arg :: with_name ( "course" ) . value_name ( "course" ) . required ( true ) ) ,
32- )
30+ . about ( "List the exercises for a specific course" )
31+ . arg ( Arg :: with_name ( "course" ) . value_name ( "course" ) . required ( true ) ) ,
32+ )
3333 . subcommand (
3434 SubCommand :: with_name ( "login" )
35- . about ( "Login to TMC server" )
36- . arg (
37- Arg :: with_name ( "non-interactive" )
38- . short ( "n" )
39- . help ( "Initiates the non-interactive mode." )
40- . long ( "non-interactive" ) ,
35+ . about ( "Login to TMC server" )
36+ . arg (
37+ Arg :: with_name ( "non-interactive" )
38+ . short ( "n" )
39+ . help ( "Initiates the non-interactive mode." )
40+ . long ( "non-interactive" ) ,
4141 ) ,
42- )
42+ )
4343 . subcommand ( SubCommand :: with_name ( "logout" ) . about ( "Logout from TMC server" ) )
4444 . subcommand (
4545 SubCommand :: with_name ( "organization" )
46- . about ( "Change organization" )
47- . arg (
48- Arg :: with_name ( "non-interactive" )
49- . short ( "n" )
50- . help ( "Initiates the non-interactive mode." )
51- . long ( "non-interactive" ) ,
46+ . about ( "Change organization" )
47+ . arg (
48+ Arg :: with_name ( "non-interactive" )
49+ . short ( "n" )
50+ . help ( "Initiates the non-interactive mode." )
51+ . long ( "non-interactive" ) ,
5252 ) ,
53- )
53+ )
5454 . subcommand (
5555 SubCommand :: with_name ( "paste" )
56- . about ( "Submit exercise to TMC pastebin" )
57- . arg (
58- Arg :: with_name ( "exercise" )
59- . value_name ( "exercise" )
60- . required ( false ) ,
56+ . about ( "Submit exercise to TMC pastebin" )
57+ . arg (
58+ Arg :: with_name ( "exercise" )
59+ . value_name ( "exercise" )
60+ . required ( false ) ,
6161 ) ,
62- )
62+ )
6363 . subcommand (
6464 SubCommand :: with_name ( "submit" )
65- . about ( "Submit exercises to TMC server" )
66- . arg (
67- Arg :: with_name ( "exercise" )
68- . value_name ( "exercise" )
69- . required ( false ) ,
65+ . about ( "Submit exercises to TMC server" )
66+ . arg (
67+ Arg :: with_name ( "exercise" )
68+ . value_name ( "exercise" )
69+ . required ( false ) ,
7070 ) ,
71- )
71+ )
7272 . subcommand (
7373 SubCommand :: with_name ( "test" )
74- . about ( "Run local exercise tests" )
75- . arg (
76- Arg :: with_name ( "exercise" )
77- . value_name ( "exercise" )
78- . required ( false ) ,
74+ . about ( "Run local exercise tests" )
75+ . arg (
76+ Arg :: with_name ( "exercise" )
77+ . value_name ( "exercise" )
78+ . required ( false ) ,
7979 ) ,
80- )
80+ )
8181 . subcommand (
8282 SubCommand :: with_name ( "fetchupdate" )
83- . setting ( AppSettings :: Hidden )
84- . about ( "Finishes the autoupdater. Administator rights needed." ) ,
85- )
83+ . setting ( AppSettings :: Hidden )
84+ . about ( "Finishes the autoupdater. Administator rights needed." ) ,
85+ )
8686 . subcommand (
8787 SubCommand :: with_name ( "cleartemp" )
88- . setting ( AppSettings :: Hidden )
89- . about ( "Removes tempfiles. Administator rights needed." ) ,
90- )
88+ . setting ( AppSettings :: Hidden )
89+ . about ( "Removes tempfiles. Administator rights needed." ) ,
90+ )
9191 . subcommand (
9292 SubCommand :: with_name ( "elevateddownload" )
9393 . setting ( AppSettings :: Hidden )
@@ -111,13 +111,33 @@ pub fn build_cli() -> App<'static, 'static> {
111111 . subcommand ( SubCommand :: with_name ( "update" ) . about ( "Update exercises" ) )
112112 . arg (
113113 Arg :: with_name ( "no-update" )
114- . short ( "d" )
115- . long ( "no-update" )
116- . help ( "Disable auto update temporarily" ) ,
117- )
114+ . short ( "d" )
115+ . long ( "no-update" )
116+ . help ( "Disable auto update temporarily" ) ,
117+ )
118118 . arg (
119119 Arg :: with_name ( "testmode" )
120- . long ( "testmode" )
121- . help ( "Only for internal testing, disables server connection" ) ,
122- )
120+ . long ( "testmode" )
121+ . help ( "Only for internal testing, disables server connection" ) ,
122+ )
123+ . subcommand ( SubCommand :: with_name ( "generate-completions" )
124+ . usage ( "tmc generate_completions --[your shell] > /path/to/your/completions/folder" )
125+ . about ( "Generate completion scripts for command line usage." )
126+ . setting ( AppSettings :: DisableVersion )
127+ . setting ( AppSettings :: Hidden )
128+ . setting ( AppSettings :: DeriveDisplayOrder )
129+ . arg (
130+ Arg :: with_name ( "bash" )
131+ . short ( "b" )
132+ . long ( "bash" ) )
133+ . arg (
134+ Arg :: with_name ( "zsh" )
135+ . short ( "z" )
136+ . long ( "zsh" )
137+ )
138+ . arg (
139+ Arg :: with_name ( "powershell" )
140+ . short ( "p" )
141+ . long ( "powershell" ) )
142+ )
123143}
0 commit comments