kopia lustrzana https://github.com/browsh-org/browsh
Improved CLI's flags and changed help page (#341)
* Improved CLI's flags Allowed users to use just --v instead of --version as a CLI flag. Also added in the --name flag that simply prints out "Browsh." An alias for the --name flag is --n. * Changed the help page inside the config.go to include the name flagpull/344/head
rodzic
84f5382eda
commit
13dfd9288a
|
@ -204,10 +204,20 @@ func MainEntry() {
|
|||
}
|
||||
viper.SetDefault("validURL", validURL)
|
||||
Initialise()
|
||||
if viper.GetBool("version") {
|
||||
|
||||
// Print version if asked and exit
|
||||
if (viper.GetBool("version") || viper.GetBool("v")) {
|
||||
println(browshVersion)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// Print name if asked and exit
|
||||
if (viper.GetBool("name") || viper.GetBool("n")) {
|
||||
println("Browsh")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// Decide whether to run in http-server-mode or CLI app
|
||||
if viper.GetBool("http-server-mode") {
|
||||
HTTPServerStart()
|
||||
} else {
|
||||
|
|
|
@ -24,6 +24,7 @@ var (
|
|||
_ = pflag.Bool("firefox.with-gui", false, "Don't use headless Firefox")
|
||||
_ = pflag.Bool("firefox.use-existing", false, "Whether Browsh should launch Firefox or not")
|
||||
_ = pflag.Bool("monochrome", false, "Start browsh in monochrome mode")
|
||||
_ = pflag.Bool("name", false, "Print out the name: Browsh")
|
||||
)
|
||||
|
||||
func getConfigNamespace() string {
|
||||
|
|
Ładowanie…
Reference in New Issue