2024-12-02 06:59:56 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
/*
|
|
|
|
this parses the command line arguements
|
|
|
|
*/
|
|
|
|
|
|
|
|
var argv args
|
|
|
|
|
|
|
|
type args struct {
|
2024-12-14 13:12:42 -06:00
|
|
|
Config bool `arg:"--config" help:"work from your .config/forge/ configuration"`
|
|
|
|
FindAll bool `arg:"--find-all" help:"select every repo"`
|
|
|
|
FindReadOnly bool `arg:"--find-readonly" help:"include read-only repos"`
|
|
|
|
FindMine bool `arg:"--find-mine" help:"download private and writeable repos"`
|
|
|
|
FindFavorites bool `arg:"--find-favorites" help:"download repos marked as favorites"`
|
|
|
|
FindPrivate bool `arg:"--find-private" help:"list private repos in .config/forge/"`
|
|
|
|
DoList bool `arg:"--do-list" help:"list found repos"`
|
|
|
|
DoScan bool `arg:"--do-scan" help:"rescan your repos"`
|
|
|
|
DoClone bool `arg:"--do-clone" help:"go-clone things you are missing"`
|
|
|
|
DoForce bool `arg:"--do-force" help:"force redo go-clone"`
|
|
|
|
DoGitPull bool `arg:"--do-git-pull" help:"run 'git pull' on all your repos"`
|
|
|
|
DoGitReset bool `arg:"--do-git-reset" help:"run 'git reset --hard' on all read-only repos"`
|
|
|
|
DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
|
|
|
DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
|
|
|
|
DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
|
|
|
DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
|
2024-12-14 14:09:15 -06:00
|
|
|
ListPatchSet bool `arg:"--list-patches" help:"make patch set"`
|
2024-12-14 13:12:42 -06:00
|
|
|
DoGui bool `arg:"--do-gui" help:"test the gui"`
|
|
|
|
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
|
|
|
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
|
|
|
URL string `arg:"--url" default:"http://go.wit.com/" help:"base url"`
|
2024-12-17 15:34:13 -06:00
|
|
|
Delete string `arg:"--delete" help:"delete this repo"`
|
2024-12-02 06:59:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (args) Version() string {
|
|
|
|
return "forge " + VERSION + " Built on " + BUILDTIME
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a args) Description() string {
|
|
|
|
return `
|
|
|
|
forge -- in the spirit of things like sourceforge
|
|
|
|
|
|
|
|
Examples:
|
2024-12-05 12:29:47 -06:00
|
|
|
forge --config # shows your forge config (~/.config/forge/)
|
|
|
|
forge --mine # find your private and writable repos
|
|
|
|
forge --favorites # find configured as favorites
|
|
|
|
|
2024-12-02 06:59:56 -06:00
|
|
|
forge --git-pull # run 'git pull' in every repo
|
2024-12-05 12:29:47 -06:00
|
|
|
forge --build --dry-run # build every binary package (but just show what would run)
|
|
|
|
forge --mine --clone # clone every package you have in your config file
|
2024-12-02 06:59:56 -06:00
|
|
|
`
|
|
|
|
}
|