This repository was archived by the owner on Oct 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,23 @@ func newConfigureCmd() *cobra.Command {
1414 Use : "configure [--context-size=<n>] MODEL [-- <runtime-flags...>]" ,
1515 Short : "Configure runtime options for a model" ,
1616 Args : func (cmd * cobra.Command , args []string ) error {
17- if len (args ) < 1 {
18- return fmt .Errorf (
19- "Model specification is required.\n \n " +
20- "See 'docker model configure --help' for more information" ,
21- )
17+ argsBeforeDash := cmd .ArgsLenAtDash ()
18+ if argsBeforeDash == - 1 {
19+ // No "--" used, so we need exactly 1 total argument.
20+ if len (args ) != 1 {
21+ return fmt .Errorf (
22+ "Exactly one model must be specified, got %d: %v\n \n " +
23+ "See 'docker model configure --help' for more information" ,
24+ len (args ), args )
25+ }
26+ } else {
27+ // Has "--", so we need exactly 1 argument before it.
28+ if argsBeforeDash != 1 {
29+ return fmt .Errorf (
30+ "Exactly one model must be specified before --, got %d\n \n " +
31+ "See 'docker model configure --help' for more information" ,
32+ argsBeforeDash )
33+ }
2234 }
2335 opts .Model = args [0 ]
2436 opts .RuntimeFlags = args [1 :]
You can’t perform that action at this time.
0 commit comments