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: 2024-12-18 05:19 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.