You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: cmd/rudi/options/options.go
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ type Options struct {
21
21
ShowHelpbool
22
22
Interactivebool
23
23
ScriptFilestring
24
+
LibraryFiles []string
24
25
StdinFormat types.Encoding
25
26
OutputFormat types.Encoding
26
27
PrintAstbool
@@ -49,6 +50,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
49
50
50
51
fs.BoolVarP(&o.Interactive, "interactive", "i", o.Interactive, "Start an interactive REPL to run expressions.")
51
52
fs.StringVarP(&o.ScriptFile, "script", "s", o.ScriptFile, "Load Rudi script from file instead of first argument (only in non-interactive mode).")
53
+
fs.StringArrayVarP(&o.LibraryFiles, "library", "l", o.LibraryFiles, "Load additional Rudi file(s) to be be evaluated before the script (can be given multiple times).")
52
54
fs.StringArrayVar(&o.extraVariableFlags, "var", o.extraVariableFlags, "Define additional global variables (can be given multiple times).")
53
55
stdinFormatFlag.Add(fs, "stdin-format", "f", "What data format is used for data provided on stdin")
54
56
outputFormatFlag.Add(fs, "output-format", "o", "What data format to use for outputting data")
@@ -60,10 +62,6 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
60
62
}
61
63
62
64
func (o*Options) Validate() error {
63
-
ifo.Interactive&&o.ScriptFile!="" {
64
-
returnerrors.New("cannot combine --interactive with --script")
65
-
}
66
-
67
65
ifo.Interactive&&o.PrintAst {
68
66
returnerrors.New("cannot combine --interactive with --debug-ast")
69
67
}
@@ -72,6 +70,10 @@ func (o *Options) Validate() error {
0 commit comments