Skip to content

Commit 6375708

Browse files
committed
add shortcuts for flags
1 parent af37191 commit 6375708

1 file changed

Lines changed: 31 additions & 31 deletions

File tree

spec/flags.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
11
package spec
22

33
type ConfigSetFlags struct {
4-
Name string `flagName:"name" flagDefault:"" flagDescription:"user name"`
5-
Email string `flagName:"email" flagDefault:"" flagDescription:"user email"`
6-
URL string `flagName:"url" flagDefault:"" flagDescription:"rewrite target url"`
7-
InsteadOf string `flagName:"instead-of" flagDefault:"" flagDescription:"rewrite source prefix"`
8-
Global bool `flagName:"global" flagDefault:"false" flagDescription:"write to global config"`
4+
Name string `flagName:"name" flagDefault:"" flagShortName:"n" flagDescription:"user name"`
5+
Email string `flagName:"email" flagDefault:"" flagShortName:"e" flagDescription:"user email"`
6+
URL string `flagName:"url" flagDefault:"" flagShortName:"u" flagDescription:"rewrite target url"`
7+
InsteadOf string `flagName:"instead-of" flagDefault:"" flagShortName:"i" flagDescription:"rewrite source prefix"`
8+
Global bool `flagName:"global" flagDefault:"false" flagShortName:"g" flagDescription:"write to global config"`
99
}
1010

1111
type RepoInitFlags struct {
12-
Backend string `flagName:"backend" flagRequired:"true" flagDescription:"backend name like git or svn"`
12+
Backend string `flagName:"backend" flagRequired:"true" flagShortName:"b" flagDescription:"backend name like git or svn"`
1313
}
1414

1515
type RepoCloneFlags struct {
16-
URL string `flagName:"url" flagRequired:"true" flagDescription:"repository url"`
17-
Path string `flagName:"path" flagDefault:"" flagDescription:"destination directory"`
16+
URL string `flagName:"url" flagRequired:"true" flagShortName:"u" flagDescription:"repository url"`
17+
Path string `flagName:"path" flagDefault:"" flagShortName:"p" flagDescription:"destination directory"`
1818
}
1919

2020
type BranchListFlags struct {
21-
Local bool `flagName:"local" flagDefault:"true" flagDescription:"local branches"`
22-
Remote bool `flagName:"remote" flagDefault:"false" flagDescription:"remote branches"`
21+
Local bool `flagName:"local" flagDefault:"true" flagShortName:"l" flagDescription:"local branches"`
22+
Remote bool `flagName:"remote" flagDefault:"false" flagShortName:"r" flagDescription:"remote branches"`
2323
}
2424

2525
type BranchSwitchFlags struct {
26-
Name string `flagName:"name" flagRequired:"true" flagDescription:"branch name"`
27-
Local bool `flagName:"local" flagDefault:"true" flagDescription:"is local"`
28-
Remote bool `flagName:"remote" flagDefault:"false" flagDescription:"is remote"`
26+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"branch name"`
27+
Local bool `flagName:"local" flagDefault:"true" flagShortName:"l" flagDescription:"is local"`
28+
Remote bool `flagName:"remote" flagDefault:"false" flagShortName:"r" flagDescription:"is remote"`
2929
}
3030

3131
type BranchCreateFlags struct {
32-
Name string `flagName:"name" flagRequired:"true" flagDescription:"branch name"`
33-
From string `flagName:"from" flagDefault:"" flagDescription:"existing branch name"`
32+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"branch name"`
33+
From string `flagName:"from" flagDefault:"" flagShortName:"f" flagDescription:"existing branch name"`
3434
}
3535

3636
type BranchDeleteFlags struct {
37-
Name string `flagName:"name" flagRequired:"true" flagDescription:"branch name"`
38-
Local bool `flagName:"local" flagDefault:"true" flagDescription:"is local"`
39-
Remote bool `flagName:"remote" flagDefault:"false" flagDescription:"is remote"`
40-
Force bool `flagName:"force" flagDefault:"false" flagDescription:"force"`
37+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"branch name"`
38+
Local bool `flagName:"local" flagDefault:"true" flagShortName:"l" flagDescription:"is local"`
39+
Remote bool `flagName:"remote" flagDefault:"false" flagShortName:"r" flagDescription:"is remote"`
40+
Force bool `flagName:"force" flagDefault:"false" flagShortName:"f" flagDescription:"force"`
4141
}
4242

4343
type BranchMergeFlags struct {
44-
Name string `flagName:"name" flagRequired:"true" flagDescription:"branch or ref name"`
44+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"branch or ref name"`
4545
}
4646

4747
type BranchRebaseFlags struct {
48-
Name string `flagName:"name" flagRequired:"true" flagDescription:"branch or ref name"`
48+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"branch or ref name"`
4949
}
5050

5151
type CommitSaveFlags struct {
52-
Note string `flagName:"note" flagRequired:"true" flagDescription:"change notes"`
52+
Note string `flagName:"note" flagRequired:"true" flagShortName:"n" flagDescription:"change notes"`
5353
}
5454

5555
type ChangeFileFlags struct {
56-
File string `flagName:"file" flagRequired:"true" flagDescription:"file path"`
56+
File string `flagName:"file" flagRequired:"true" flagShortName:"f" flagDescription:"file path"`
5757
}
5858

5959
type ChangeDiffFlags struct {
60-
File string `flagName:"file" flagDefault:"" flagDescription:"file path"`
60+
File string `flagName:"file" flagDefault:"" flagShortName:"f" flagDescription:"file path"`
6161
}
6262

6363
type StashAddFlags struct {
64-
Name string `flagName:"name" flagRequired:"true" flagDescription:"stash name"`
65-
File string `flagName:"file" flagRequired:"true" flagDescription:"file path"`
64+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"stash name"`
65+
File string `flagName:"file" flagRequired:"true" flagShortName:"f" flagDescription:"file path"`
6666
}
6767

6868
type StashRemoveFlags struct {
69-
Name string `flagName:"name" flagRequired:"true" flagDescription:"stash name"`
70-
File string `flagName:"file" flagRequired:"true" flagDescription:"file path"`
69+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"stash name"`
70+
File string `flagName:"file" flagRequired:"true" flagShortName:"f" flagDescription:"file path"`
7171
}
7272

7373
type StashDeleteFlags struct {
74-
Name string `flagName:"name" flagRequired:"true" flagDescription:"stash name"`
74+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"stash name"`
7575
}
7676

7777
type TagCreateFlags struct {
78-
Name string `flagName:"name" flagRequired:"true" flagDescription:"tag name"`
78+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"tag name"`
7979
}
8080

8181
type TagDeleteFlags struct {
82-
Name string `flagName:"name" flagRequired:"true" flagDescription:"tag name"`
82+
Name string `flagName:"name" flagRequired:"true" flagShortName:"n" flagDescription:"tag name"`
8383
}

0 commit comments

Comments
 (0)