Skip to contentSkip to conversation

smbinfo: update notify subcommand

PATCH In review ChenXiaoSong 2 participants 2 messages Jun 12 – Jun 13

Subsystems (2)
lore
Share & tools
lore

ChenXiaoSong

author reviewer
#0 lore raw

PATCH 1/1 smbinfo: update notify subcommand

From: ChenXiaoSong <[email protected]>

Add the notify subcommand to bash-completion.

Fix the following warning:

./smbinfo:963: SyntaxWarning: 'return' in a 'finally' block
return False

---
 bash-completion/smbinfo | 5 +++--
 smbinfo                 | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)
bash-completion/smbinfo +3 -2
index 52e6821..3f1f9f6 100644
@@ -24,7 +24,8 @@ smb_info()
 	      quota
 	      secdesc
 	      keys
-	      gettconinfo"
+	      gettconinfo
+	      notify"
 	case $prev in
 		'-v'|'-h')
 			return 0
@@ -33,7 +34,7 @@ smb_info()
 		'filefsfullsizeinfo'|'fileinternalinfo'|'filemodeinfo'|'filepositioninfo'|\
 		'filestandardinfo'|'filestreaminfo'|'filecompressioninfo'|'fsctl-getobjid'|\
 		'getcompression'|'setcompression'|'list-snapshots'|'quota'|'secdesc'|'keys'|\
-		'gettconinfo')
+		'gettconinfo'|'notify')
 			local IFS=$'\n'
 			compopt -o filenames
 			COMPREPLY=( $(compgen -f -o dirnames -- ${cur:-""}) )
smbinfo +1 -2
index a6095e1..d6c30f1 100755
@@ -306,7 +306,7 @@ def main():
     sap.add_argument("file")
     sap.set_defaults(func=cmd_gettconinfo)
 
-    sap = subp.add_parser("notify", help="Query a directory for change notifications")
+    sap = subp.add_parser("notify", help="Query a directory for change notifications. Press Ctrl+C to exit.")
     sap.add_argument("file")
     sap.set_defaults(func=cmd_notify)
 
@@ -960,7 +960,6 @@ def cmd_notify(args):
         pass
     finally:
         os.close(fd)
-        return False
 
 def notify_thread(fd):
     fmt = "<IBI"
Signature · 1 line
2.54.0
#1 lore raw

added to smb3-utils for-next

Quoted 63 lines · ChenXiaoSong

From: ChenXiaoSong <[email protected]>

Add the notify subcommand to bash-completion.

Fix the following warning:

./smbinfo:963: SyntaxWarning: 'return' in a 'finally' block
return False

---
 bash-completion/smbinfo | 5 +++--
 smbinfo                 | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)
bash-completion/smbinfo +3 -2
index 52e6821..3f1f9f6 100644
@@ -24,7 +24,8 @@ smb_info()
              quota
              secdesc
              keys
-             gettconinfo"
+             gettconinfo
+             notify"
        case $prev in
                '-v'|'-h')
                        return 0
@@ -33,7 +34,7 @@ smb_info()
                'filefsfullsizeinfo'|'fileinternalinfo'|'filemodeinfo'|'filepositioninfo'|\
                'filestandardinfo'|'filestreaminfo'|'filecompressioninfo'|'fsctl-getobjid'|\
                'getcompression'|'setcompression'|'list-snapshots'|'quota'|'secdesc'|'keys'|\
-               'gettconinfo')
+               'gettconinfo'|'notify')
                        local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -o dirnames -- ${cur:-""}) )
smbinfo +1 -3
index a6095e1..d6c30f1 100755
@@ -306,7 +306,7 @@ def main():
     sap.add_argument("file")
     sap.set_defaults(func=cmd_gettconinfo)
 
-    sap = subp.add_parser("notify", help="Query a directory for change notifications")
+    sap = subp.add_parser("notify", help="Query a directory for change notifications. Press Ctrl+C to exit.")
     sap.add_argument("file")
     sap.set_defaults(func=cmd_notify)
 
@@ -960,7 +960,6 @@ def cmd_notify(args):
         pass
     finally:
         os.close(fd)
-        return False
 
 def notify_thread(fd):
     fmt = "<IBI"
--

2.54.0

Signature · 3 lines
Thanks,

Steve