update flag documentation
This commit is contained in:
parent
24bd593dd9
commit
0ce8614729
12 changed files with 70 additions and 70 deletions
|
@ -46,20 +46,20 @@ func main() {
|
||||||
|
|
||||||
func run() error {
|
func run() error {
|
||||||
commandSummaries := map[string]string{
|
commandSummaries := map[string]string{
|
||||||
commandLogin: "login to an account on GoToSocial",
|
commandLogin: "Login to an account on GoToSocial",
|
||||||
commandVersion: "print the application's version and build information",
|
commandVersion: "Print the application's version and build information",
|
||||||
commandShow: "print details about a specified resource",
|
commandShow: "Print details about a specified resource",
|
||||||
commandSwitch: "perform a switch operation (e.g. switch logged in accounts)",
|
commandSwitch: "Perform a switch operation (e.g. switch logged in accounts)",
|
||||||
commandCreate: "create a specific resource",
|
commandCreate: "Create a specific resource",
|
||||||
commandDelete: "delete a specific resource",
|
commandDelete: "Delete a specific resource",
|
||||||
commandEdit: "edit a specific resource",
|
commandEdit: "Edit a specific resource",
|
||||||
commandWhoami: "print the account that you are currently logged in to",
|
commandWhoami: "Print the account that you are currently logged in to",
|
||||||
commandAdd: "add a resource to another resource",
|
commandAdd: "Add a resource to another resource",
|
||||||
commandRemove: "remove a resource from another resource",
|
commandRemove: "Remove a resource from another resource",
|
||||||
commandFollow: "follow a resource (e.g. an account)",
|
commandFollow: "Follow a resource (e.g. an account)",
|
||||||
commandUnfollow: "unfollow a resource (e.g. an account)",
|
commandUnfollow: "Unfollow a resource (e.g. an account)",
|
||||||
commandBlock: "block a resource (e.g. an account)",
|
commandBlock: "Block a resource (e.g. an account)",
|
||||||
commandUnblock: "unblock a resource (e.g. an account)",
|
commandUnblock: "Unblock a resource (e.g. an account)",
|
||||||
}
|
}
|
||||||
|
|
||||||
topLevelFlags := executor.TopLevelFlags{
|
topLevelFlags := executor.TopLevelFlags{
|
||||||
|
@ -68,8 +68,8 @@ func run() error {
|
||||||
Pager: "",
|
Pager: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
flag.StringVar(&topLevelFlags.ConfigDir, "config-dir", "", "specify your config directory")
|
flag.StringVar(&topLevelFlags.ConfigDir, "config-dir", "", "Specify your config directory")
|
||||||
flag.BoolFunc("no-color", "disable ANSI colour output when displaying text on screen", func(value string) error {
|
flag.BoolFunc("no-color", "Disable ANSI colour output when displaying text on screen", func(value string) error {
|
||||||
boolVal, err := strconv.ParseBool(value)
|
boolVal, err := strconv.ParseBool(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to parse %q as a boolean: %w", value, err)
|
return fmt.Errorf("unable to parse %q as a boolean: %w", value, err)
|
||||||
|
@ -80,7 +80,7 @@ func run() error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
flag.StringVar(&topLevelFlags.Pager, "pager", "", "specify your preferred pager if you would like pager support")
|
flag.StringVar(&topLevelFlags.Pager, "pager", "", "Specify your preferred pager to page through long outputs. This is disabled by default.")
|
||||||
|
|
||||||
flag.Usage = usageFunc(commandSummaries)
|
flag.Usage = usageFunc(commandSummaries)
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,12 @@ func NewAddExecutor(tlf TopLevelFlags, name, summary string) *AddExecutor {
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
addExe.StringVar(&addExe.resourceType, flagType, "", "specify the resource type to add (e.g. account, note)")
|
addExe.StringVar(&addExe.resourceType, flagType, "", "Specify the resource type to add (e.g. account, note)")
|
||||||
addExe.StringVar(&addExe.toResourceType, flagTo, "", "specify the target resource type to add to (e.g. list, account, etc)")
|
addExe.StringVar(&addExe.toResourceType, flagTo, "", "Specify the target resource type to add to (e.g. list, account, etc)")
|
||||||
addExe.StringVar(&addExe.listID, flagListID, "", "the ID of the list to add to")
|
addExe.StringVar(&addExe.listID, flagListID, "", "The ID of the list to add to")
|
||||||
addExe.StringVar(&addExe.statusID, flagStatusID, "", "the ID of the status")
|
addExe.StringVar(&addExe.statusID, flagStatusID, "", "The ID of the status")
|
||||||
addExe.Var(&addExe.accountNames, flagAccountName, "the name of the account")
|
addExe.Var(&addExe.accountNames, flagAccountName, "The name of the account")
|
||||||
addExe.StringVar(&addExe.content, flagContent, "", "the content of the note")
|
addExe.StringVar(&addExe.content, flagContent, "", "The content of the resource")
|
||||||
|
|
||||||
addExe.Usage = commandUsageFunc(name, summary, addExe.FlagSet)
|
addExe.Usage = commandUsageFunc(name, summary, addExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ func NewBlockExecutor(tlf TopLevelFlags, name, summary string, unblock bool) *Bl
|
||||||
unblock: unblock,
|
unblock: unblock,
|
||||||
}
|
}
|
||||||
|
|
||||||
blockExe.StringVar(&blockExe.resourceType, flagType, "", "specify the type of resource to block or unblock")
|
blockExe.StringVar(&blockExe.resourceType, flagType, "", "Specify the type of resource to block or unblock")
|
||||||
blockExe.StringVar(&blockExe.accountName, flagAccountName, "", "specify the account name in full (username@domain)")
|
blockExe.StringVar(&blockExe.accountName, flagAccountName, "", "Specify the account name in full (username@domain)")
|
||||||
|
|
||||||
blockExe.Usage = commandUsageFunc(name, summary, blockExe.FlagSet)
|
blockExe.Usage = commandUsageFunc(name, summary, blockExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -41,21 +41,21 @@ func NewCreateExecutor(tlf TopLevelFlags, name, summary string) *CreateExecutor
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
createExe.BoolVar(&createExe.boostable, flagEnableReposts, true, "specify if the status can be reposted/boosted by others")
|
createExe.BoolVar(&createExe.boostable, flagEnableReposts, true, "Specify if the status can be reposted/boosted by others")
|
||||||
createExe.BoolVar(&createExe.federated, flagEnableFederation, true, "specify if the status can be federated beyond the local timelines")
|
createExe.BoolVar(&createExe.federated, flagEnableFederation, true, "Specify if the status can be federated beyond the local timelines")
|
||||||
createExe.BoolVar(&createExe.likeable, flagEnableLikes, true, "specify if the status can be liked/favourited")
|
createExe.BoolVar(&createExe.likeable, flagEnableLikes, true, "Specify if the status can be liked/favourited")
|
||||||
createExe.BoolVar(&createExe.replyable, flagEnableReplies, true, "specify if the status can be replied to")
|
createExe.BoolVar(&createExe.replyable, flagEnableReplies, true, "Specify if the status can be replied to")
|
||||||
createExe.StringVar(&createExe.content, flagContent, "", "the content of the status to create")
|
createExe.StringVar(&createExe.content, flagContent, "", "The content of the status to create")
|
||||||
createExe.StringVar(&createExe.contentType, flagContentType, "plain", "the type that the contents should be parsed from (valid values are plain and markdown)")
|
createExe.StringVar(&createExe.contentType, flagContentType, "plain", "The type that the contents should be parsed from (valid values are plain and markdown)")
|
||||||
createExe.StringVar(&createExe.fromFile, flagFromFile, "", "the file path where to read the contents from")
|
createExe.StringVar(&createExe.fromFile, flagFromFile, "", "The file path where to read the contents from")
|
||||||
createExe.StringVar(&createExe.language, flagLanguage, "", "the ISO 639 language code for this status")
|
createExe.StringVar(&createExe.language, flagLanguage, "", "The ISO 639 language code for this status")
|
||||||
createExe.StringVar(&createExe.spoilerText, flagSpoilerText, "", "the text to display as the status' warning or subject")
|
createExe.StringVar(&createExe.spoilerText, flagSpoilerText, "", "The text to display as the status' warning or subject")
|
||||||
createExe.StringVar(&createExe.visibility, flagVisibility, "", "the visibility of the posted status")
|
createExe.StringVar(&createExe.visibility, flagVisibility, "", "The visibility of the posted status")
|
||||||
createExe.StringVar(&createExe.resourceType, flagType, "", "specify the type of resource to create")
|
createExe.StringVar(&createExe.resourceType, flagType, "", "Specify the type of resource to create")
|
||||||
createExe.StringVar(&createExe.listTitle, flagListTitle, "", "specify the title of the list")
|
createExe.StringVar(&createExe.listTitle, flagListTitle, "", "Specify the title of the list")
|
||||||
createExe.StringVar(&createExe.listRepliesPolicy, flagListRepliesPolicy, "list", "specify the policy of the replies for this list (valid values are followed, list and none)")
|
createExe.StringVar(&createExe.listRepliesPolicy, flagListRepliesPolicy, "list", "Specify the policy of the replies for this list (valid values are followed, list and none)")
|
||||||
|
|
||||||
createExe.BoolFunc(flagSensitive, "specify if the status should be marked as sensitive", func(value string) error {
|
createExe.BoolFunc(flagSensitive, "Specify if the status should be marked as sensitive", func(value string) error {
|
||||||
boolVal, err := strconv.ParseBool(value)
|
boolVal, err := strconv.ParseBool(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to parse %q as a boolean value: %w", value, err)
|
return fmt.Errorf("unable to parse %q as a boolean value: %w", value, err)
|
||||||
|
|
|
@ -25,8 +25,8 @@ func NewDeleteExecutor(tlf TopLevelFlags, name, summary string) *DeleteExecutor
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteExe.StringVar(&deleteExe.resourceType, flagType, "", "specify the type of resource to delete")
|
deleteExe.StringVar(&deleteExe.resourceType, flagType, "", "Specify the type of resource to delete")
|
||||||
deleteExe.StringVar(&deleteExe.listID, flagListID, "", "specify the ID of the list to delete")
|
deleteExe.StringVar(&deleteExe.listID, flagListID, "", "Specify the ID of the list to delete")
|
||||||
|
|
||||||
deleteExe.Usage = commandUsageFunc(name, summary, deleteExe.FlagSet)
|
deleteExe.Usage = commandUsageFunc(name, summary, deleteExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,10 @@ func NewEditExecutor(tlf TopLevelFlags, name, summary string) *EditExecutor {
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
editExe.StringVar(&editExe.resourceType, flagType, "", "specify the type of resource to update")
|
editExe.StringVar(&editExe.resourceType, flagType, "", "Specify the type of resource to update")
|
||||||
editExe.StringVar(&editExe.listID, flagListID, "", "specify the ID of the list to update")
|
editExe.StringVar(&editExe.listID, flagListID, "", "Specify the ID of the list to update")
|
||||||
editExe.StringVar(&editExe.listTitle, flagListTitle, "", "specify the title of the list")
|
editExe.StringVar(&editExe.listTitle, flagListTitle, "", "Specify the title of the list")
|
||||||
editExe.StringVar(&editExe.listRepliesPolicy, flagListRepliesPolicy, "", "specify the policy of the replies for this list (valid values are followed, list and none)")
|
editExe.StringVar(&editExe.listRepliesPolicy, flagListRepliesPolicy, "", "Specify the policy of the replies for this list (valid values are followed, list and none)")
|
||||||
|
|
||||||
editExe.Usage = commandUsageFunc(name, summary, editExe.FlagSet)
|
editExe.Usage = commandUsageFunc(name, summary, editExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,10 @@ func NewFollowExecutor(tlf TopLevelFlags, name, summary string, unfollow bool) *
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
command.StringVar(&command.resourceType, flagType, "", "specify the type of resource to follow")
|
command.StringVar(&command.resourceType, flagType, "", "Specify the type of resource to follow")
|
||||||
command.StringVar(&command.accountName, flagAccountName, "", "specify the account name in full (username@domain)")
|
command.StringVar(&command.accountName, flagAccountName, "", "Specify the account name in full (username@domain)")
|
||||||
command.BoolVar(&command.showReposts, flagShowReposts, true, "show reposts from the account you want to follow")
|
command.BoolVar(&command.showReposts, flagShowReposts, true, "Show reposts from the account you want to follow")
|
||||||
command.BoolVar(&command.notify, flagNotify, false, "get notifications when the account you want to follow posts a status")
|
command.BoolVar(&command.notify, flagNotify, false, "Get notifications when the account you want to follow posts a status")
|
||||||
|
|
||||||
command.Usage = commandUsageFunc(name, summary, command.FlagSet)
|
command.Usage = commandUsageFunc(name, summary, command.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ func NewLoginExecutor(tlf TopLevelFlags, name, summary string) *LoginExecutor {
|
||||||
instance: "",
|
instance: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
command.StringVar(&command.instance, flagInstance, "", "specify the instance that you want to login to.")
|
command.StringVar(&command.instance, flagInstance, "", "Specify the instance that you want to login to.")
|
||||||
|
|
||||||
command.Usage = commandUsageFunc(name, summary, command.FlagSet)
|
command.Usage = commandUsageFunc(name, summary, command.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,11 @@ func NewRemoveExecutor(tlf TopLevelFlags, name, summary string) *RemoveExecutor
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
removeExe.StringVar(&removeExe.resourceType, flagType, "", "specify the resource type to remove (e.g. account, note)")
|
removeExe.StringVar(&removeExe.resourceType, flagType, "", "Specify the resource type to remove (e.g. account, note)")
|
||||||
removeExe.StringVar(&removeExe.fromResourceType, flagFrom, "", "specify the resource type to remove from (e.g. list, account, etc)")
|
removeExe.StringVar(&removeExe.fromResourceType, flagFrom, "", "Specify the resource type to remove from (e.g. list, account, etc)")
|
||||||
removeExe.StringVar(&removeExe.listID, flagListID, "", "the ID of the list to remove from")
|
removeExe.StringVar(&removeExe.listID, flagListID, "", "The ID of the list to remove from")
|
||||||
removeExe.StringVar(&removeExe.statusID, flagStatusID, "", "the ID of the status")
|
removeExe.StringVar(&removeExe.statusID, flagStatusID, "", "The ID of the status")
|
||||||
removeExe.Var(&removeExe.accountNames, flagAccountName, "the name of the account to remove from the resource")
|
removeExe.Var(&removeExe.accountNames, flagAccountName, "The name of the account to remove from the resource")
|
||||||
|
|
||||||
removeExe.Usage = commandUsageFunc(name, summary, removeExe.FlagSet)
|
removeExe.Usage = commandUsageFunc(name, summary, removeExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -35,17 +35,17 @@ func NewShowExecutor(tlf TopLevelFlags, name, summary string) *ShowExecutor {
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
showExe.BoolVar(&showExe.myAccount, flagMyAccount, false, "set to true to lookup your account")
|
showExe.BoolVar(&showExe.myAccount, flagMyAccount, false, "Set to true to lookup your account")
|
||||||
showExe.BoolVar(&showExe.skipAccountRelationship, flagSkipRelationship, false, "set to true to skip showing your relationship to the specified account")
|
showExe.BoolVar(&showExe.skipAccountRelationship, flagSkipRelationship, false, "Set to true to skip showing your relationship to the specified account")
|
||||||
showExe.BoolVar(&showExe.showUserPreferences, flagShowPreferences, false, "show your preferences")
|
showExe.BoolVar(&showExe.showUserPreferences, flagShowPreferences, false, "Show your preferences")
|
||||||
showExe.BoolVar(&showExe.showInBrowser, flagBrowser, false, "set to true to view in the browser")
|
showExe.BoolVar(&showExe.showInBrowser, flagBrowser, false, "Set to true to view in the browser")
|
||||||
showExe.StringVar(&showExe.resourceType, flagType, "", "specify the type of resource to display")
|
showExe.StringVar(&showExe.resourceType, flagType, "", "Specify the type of resource to display")
|
||||||
showExe.StringVar(&showExe.accountName, flagAccountName, "", "specify the account name in full (username@domain)")
|
showExe.StringVar(&showExe.accountName, flagAccountName, "", "Specify the account name in full (username@domain)")
|
||||||
showExe.StringVar(&showExe.statusID, flagStatusID, "", "specify the ID of the status to display")
|
showExe.StringVar(&showExe.statusID, flagStatusID, "", "Specify the ID of the status to display")
|
||||||
showExe.StringVar(&showExe.timelineCategory, flagTimelineCategory, model.TimelineCategoryHome, "specify the timeline category to view")
|
showExe.StringVar(&showExe.timelineCategory, flagTimelineCategory, model.TimelineCategoryHome, "Specify the timeline category to view")
|
||||||
showExe.StringVar(&showExe.listID, flagListID, "", "specify the ID of the list to display")
|
showExe.StringVar(&showExe.listID, flagListID, "", "Specify the ID of the list to display")
|
||||||
showExe.StringVar(&showExe.tag, flagTag, "", "specify the name of the tag to use")
|
showExe.StringVar(&showExe.tag, flagTag, "", "Specify the name of the tag to use")
|
||||||
showExe.IntVar(&showExe.limit, flagLimit, 20, "specify the limit of items to display")
|
showExe.IntVar(&showExe.limit, flagLimit, 20, "Specify the limit of items to display")
|
||||||
|
|
||||||
showExe.Usage = commandUsageFunc(name, summary, showExe.FlagSet)
|
showExe.Usage = commandUsageFunc(name, summary, showExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ func NewSwitchExecutor(tlf TopLevelFlags, name, summary string) *SwitchExecutor
|
||||||
topLevelFlags: tlf,
|
topLevelFlags: tlf,
|
||||||
}
|
}
|
||||||
|
|
||||||
switchExe.StringVar(&switchExe.toResourceType, flagTo, "", "the account to switch to")
|
switchExe.StringVar(&switchExe.toResourceType, flagTo, "", "The account to switch to")
|
||||||
switchExe.StringVar(&switchExe.accountName, flagAccountName, "", "the name of the account to switch to")
|
switchExe.StringVar(&switchExe.accountName, flagAccountName, "", "The name of the account to switch to")
|
||||||
|
|
||||||
switchExe.Usage = commandUsageFunc(name, summary, switchExe.FlagSet)
|
switchExe.Usage = commandUsageFunc(name, summary, switchExe.FlagSet)
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ func NewVersionExecutor(name, summary, binaryVersion, buildTime, goVersion, gitC
|
||||||
showFullVersion: false,
|
showFullVersion: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
command.BoolVar(&command.showFullVersion, "full", false, "prints the full build information")
|
command.BoolVar(&command.showFullVersion, "Full", false, "prints the full build information")
|
||||||
|
|
||||||
command.Usage = commandUsageFunc(name, summary, command.FlagSet)
|
command.Usage = commandUsageFunc(name, summary, command.FlagSet)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue