mirror of
https://github.com/antonmedv/fx
synced 2024-11-11 07:10:28 +00:00
Show help by default
This commit is contained in:
parent
9bc7ab1a3c
commit
6fab9ce2e3
10
help.go
10
help.go
@ -22,11 +22,11 @@ func usage(keyMap KeyMap) string {
|
|||||||
curl ... | fx
|
curl ... | fx
|
||||||
|
|
||||||
%v
|
%v
|
||||||
-h, --help Print help
|
-h, --help print help
|
||||||
-v, --version Print version
|
-v, --version print version
|
||||||
--themes Print themes
|
--themes print themes
|
||||||
-r, --raw Treat input as a raw string
|
-r, --raw treat input as a raw string
|
||||||
-s, --slurp Read all inputs into an array
|
-s, --slurp read all inputs into an array
|
||||||
|
|
||||||
%v
|
%v
|
||||||
%v
|
%v
|
||||||
|
5
main.go
5
main.go
@ -73,7 +73,10 @@ func main() {
|
|||||||
var fileName string
|
var fileName string
|
||||||
var src io.Reader
|
var src io.Reader
|
||||||
|
|
||||||
if stdinIsTty && len(args) == 1 {
|
if stdinIsTty && len(args) == 0 {
|
||||||
|
fmt.Println(usage(keyMap))
|
||||||
|
return
|
||||||
|
} else if stdinIsTty && len(args) == 1 {
|
||||||
filePath := args[0]
|
filePath := args[0]
|
||||||
f, err := os.Open(filePath)
|
f, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user