Skip to content

Commit

Permalink
Improvements for shebang-script handling (#758)
Browse files Browse the repository at this point in the history
* Experimental #!/usr/bin/env mlr -s feature

* Allow flags after verbs, for shebang support
  • Loading branch information
johnkerl authored Nov 24, 2021
1 parent 191bdfa commit d9dbb1e
Show file tree
Hide file tree
Showing 68 changed files with 920 additions and 206 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ dev:
make -C docs
@echo DONE

# Keystroke-saver
itso: build check install
# Keystroke-savers
it: build check
so: install

# Please see comments in ./create-release-tarball as well as
# https://miller.readthedocs.io/en/latest/build/#creating-a-new-release-for-developers
Expand Down
2 changes: 1 addition & 1 deletion docs/src/manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2979,5 +2979,5 @@ SEE ALSO



2021-11-23 MILLER(1)
2021-11-24 MILLER(1)
</pre>
2 changes: 1 addition & 1 deletion docs/src/manpage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2958,4 +2958,4 @@ SEE ALSO



2021-11-23 MILLER(1)
2021-11-24 MILLER(1)
6 changes: 3 additions & 3 deletions internal/pkg/auxents/repl/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func ReplMain(args []string) int {
argi += 1
}

} else if cli.FLAG_TABLE.Parse(args, argc, &argi, &options) {
} else if cli.FLAG_TABLE.Parse(args, argc, &argi, options) {

} else {
replUsage(replName, os.Stderr, 1)
Expand All @@ -150,7 +150,7 @@ func ReplMain(args []string) int {
// --auto-flatten is on by default. But if input and output formats are both JSON,
// then we don't need to actually do anything. See also mlrcli_parse.go.
options.WriterOptions.AutoFlatten = cli.DecideFinalFlatten(&options.WriterOptions)
options.WriterOptions.AutoUnflatten = cli.DecideFinalUnflatten(&options)
options.WriterOptions.AutoUnflatten = cli.DecideFinalUnflatten(options)

repl, err := NewRepl(
exeName,
Expand All @@ -159,7 +159,7 @@ func ReplMain(args []string) int {
showPrompts,
astPrintMode,
doWarnings,
&options,
options,
)
if err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/cli/option_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ type TOptions struct {
}

// ----------------------------------------------------------------
func DefaultOptions() TOptions {
return TOptions{
func DefaultOptions() *TOptions {
return &TOptions{
ReaderOptions: DefaultReaderOptions(),
WriterOptions: DefaultWriterOptions(),

Expand Down
Loading

0 comments on commit d9dbb1e

Please sign in to comment.