Bug 15770 - samba-tool -V says 'no such subcommand'
Summary: samba-tool -V says 'no such subcommand'
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.20.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Douglas Bagnall
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-16 16:02 UTC by Rowland Penny
Modified: 2025-02-08 03:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rowland Penny 2024-12-16 16:02:50 UTC
If you run 'samba-tool -V' it returns 'samba-tool: no such subcommand: -V'

'-V' is a valid subcommand

The fix is:

in samba/netcmd/__init__.py
 
at line 352, replace:
 
                  continue
With:
                 return (self, deferred_args)

Without the 'return' it falls down into:
 
          # We didn't find a subcommand, but maybe we found e.g. --version
          print("%s: missing subcommand\n" % (path), file=self.outf)
          return (self, deferred_args)
 
There is probably a better way of fixing it, but it works for me.
Comment 1 Samba QA Contact 2025-02-08 03:31:04 UTC
This bug was referenced in samba master:

fd59b316b80eac6fc1c2e62193995adc09d099cd
3a408f06aeaceb22ea23f6f6e8118fb8e0490591
8aec198306ed005a815220e6ca3dfed6774290b2
a61e192f25c61fc4f464585f6d4153c26aece352
6f7bc5cb12a687a8851f07788700fb44e134f894