@@ -10,99 +10,119 @@ 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" )
93- . setting ( AppSettings :: Hidden )
94- . about ( "Downloads course from the tempfile. Administator rights needed." ) ,
95- )
93+ . setting ( AppSettings :: Hidden )
94+ . about ( "Downloads course from the tempfile. Administator rights needed." ) ,
95+ )
9696 . subcommand ( SubCommand :: with_name ( "update" ) . about ( "Update exercises" ) )
9797 . arg (
9898 Arg :: with_name ( "no-update" )
99- . short ( "d" )
100- . long ( "no-update" )
101- . help ( "Disable auto update temporarily" ) ,
102- )
99+ . short ( "d" )
100+ . long ( "no-update" )
101+ . help ( "Disable auto update temporarily" ) ,
102+ )
103103 . arg (
104104 Arg :: with_name ( "testmode" )
105- . long ( "testmode" )
106- . help ( "Only for internal testing, disables server connection" ) ,
107- )
105+ . long ( "testmode" )
106+ . help ( "Only for internal testing, disables server connection" ) ,
107+ )
108+ . subcommand ( SubCommand :: with_name ( "generate-completions" )
109+ . usage ( "tmc generate_completions --[your shell] > /path/to/your/completions/folder" )
110+ . about ( "Generate completion scripts for command line usage." )
111+ . setting ( AppSettings :: DisableVersion )
112+ . setting ( AppSettings :: Hidden )
113+ . setting ( AppSettings :: DeriveDisplayOrder )
114+ . arg (
115+ Arg :: with_name ( "bash" )
116+ . short ( "b" )
117+ . long ( "bash" ) )
118+ . arg (
119+ Arg :: with_name ( "zsh" )
120+ . short ( "z" )
121+ . long ( "zsh" )
122+ )
123+ . arg (
124+ Arg :: with_name ( "powershell" )
125+ . short ( "p" )
126+ . long ( "powershell" ) )
127+ )
108128}
0 commit comments