diff --git a/cli/cli.v b/cli/cli.v index 2afd5d4c..686762a6 100644 --- a/cli/cli.v +++ b/cli/cli.v @@ -86,8 +86,10 @@ pub fn input_from_args(arguments []string) (string, []string) { opts, unmatched := options_from_arguments(args, Options{}) or { Options{}, args } mut input := opts.input if unmatched.len > 0 && (os.is_dir(unmatched[0]) || os.is_file(unmatched[0])) { - input = unmatched[0] - args.delete(args.index(input)) + if unmatched[0] != args[0] or { '' } { + input = unmatched[0] + args.delete(args.index(input)) + } } else if opts.input != '' { args.delete(args.index(opts.input)) }