Skip to content

Commit

Permalink
remove functions leftover from cli, fix up readme's link to dflag
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Feb 19, 2023
1 parent 832e562 commit b0faa83
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Extends [cli](https://github.com/fortio/cli#cli) to server `main()`s .

In addition to flags, usage and help output, arguments validation, `scli` abstracts the repetitive parts of a `main()` to setup a config directory watch for [dynamic flags](dflag) (configmap in kubernetes cases) and configuration endpoint/UI/api.
In addition to flags, usage and help output, arguments validation, `scli` abstracts the repetitive parts of a `main()` to setup a config directory watch for [dynamic flags](https://github.com/fortio/dflag) (configmap in kubernetes cases) and configuration endpoint/UI/api.

You can see real use example in a server like [proxy](https://github.com/fortio/proxy).

Expand Down
17 changes: 0 additions & 17 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,3 @@ func ServerMain() bool {
log.Printf("Starting %s %s", cli.ProgramName, cli.LongVersion)
return hasStartedServer
}

// Plural adds an "s" to the noun if i is not 1.
func Plural(i int, noun string) string {
return PluralExt(i, noun, "s")
}

// PluralExt returns the noun with an extension if i is not 1.
// Eg:
//
// PluralExt(1, "address", "es") // -> "address"
// PluralExt(3 /* or 0 */, "address", "es") // -> "addresses"
func PluralExt(i int, noun string, ext string) string {
if i == 1 {
return noun
}
return noun + ext
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module fortio.org/scli
go 1.18

require (
fortio.org/cli v0.6.1
fortio.org/cli v0.6.2
fortio.org/dflag v1.4.1
fortio.org/fortio v1.50.1
fortio.org/log v1.2.2
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
fortio.org/assert v1.1.3 h1:zXm8xiNiKvq2xG/YQ3sONAg3287XUuklKIDdjyD9pyg=
fortio.org/cli v0.5.0 h1:oaSv/yHpMRf4s1fms0UOUoWQWwCnHTCvW9m3mnK9cUs=
fortio.org/cli v0.5.0/go.mod h1:+h3Iv0kIfC3F/RnZG5seKk9VjBzA8uHQKtkQGiLqkWs=
fortio.org/cli v0.6.0 h1:gLd0/xR/1/7os9I252YIVsQWAEcUirGOlbsqQYxEsyk=
fortio.org/cli v0.6.0/go.mod h1:O3nVImKwJSvHKbMYWkqMbEagAXCS1xvSv1YbHwkKJjY=
fortio.org/cli v0.6.1 h1:V9L6ly4oz4fJjeQ5745FulIMsFAwFZvLPSUN+cKUrKk=
fortio.org/cli v0.6.1/go.mod h1:O3nVImKwJSvHKbMYWkqMbEagAXCS1xvSv1YbHwkKJjY=
fortio.org/cli v0.6.2 h1:WY/22DFh8z+qEzZXNKfHsHu5JsJhQbmnlMQSot21ifA=
fortio.org/cli v0.6.2/go.mod h1:O3nVImKwJSvHKbMYWkqMbEagAXCS1xvSv1YbHwkKJjY=
fortio.org/dflag v1.4.1 h1:WDhlHMh3yrQFrvspyN5YEyr8WATdKM2dUJlTxsjCDtI=
fortio.org/dflag v1.4.1/go.mod h1:pTEF7UEj6sHP9rj9gZG2GyhAGrrPJE4c6zOO7zB2yyI=
fortio.org/fortio v1.50.1 h1:5FSttAHQsyAsi3dzxDmSByfzDYByrWY/yw53bqOg+Kc=
Expand Down

0 comments on commit b0faa83

Please sign in to comment.