Update win_dirname and win_basename docs (#84587)

* Updated docs and examples for win_dirname and win_basename for UNC path

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/83835/merge
Abhijeet Kasurde 11 months ago committed by GitHub
parent b51ec9412e
commit 689c047e3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -5,6 +5,7 @@ DOCUMENTATION:
short_description: Get a Windows path's base name
description:
- Returns the last name component of a Windows path, what is left in the string that is not 'win_dirname'.
- While specifying an UNC (Universal Naming Convention) path, please make sure the path conforms to the UNC path syntax.
options:
_input:
description: A Windows path.
@ -16,7 +17,11 @@ DOCUMENTATION:
EXAMPLES: |
# To get the last name of a file Windows path, like 'foo.txt' out of 'C:\Users\asdf\foo.txt'
{{ mypath | win_basename }}
filename: "{{ mypath | win_basename }}"
# Get basename from the UNC path in the form of '\\<SERVER_NAME>\<SHARE_NAME>\<FILENAME.FILE_EXTENSION>'
# like '\\server1\test\foo.txt' returns 'foo.txt'
filename: "{{ mypath | win_basename }}"
RETURN:
_value:

@ -5,6 +5,7 @@ DOCUMENTATION:
short_description: Get a Windows path's directory
description:
- Returns the directory component of a Windows path, what is left in the string that is not 'win_basename'.
- While specifying an UNC (Universal Naming Convention) path, please make sure the path conforms to the UNC path syntax.
options:
_input:
description: A Windows path.
@ -18,6 +19,10 @@ EXAMPLES: |
# To get the last name of a file Windows path, like 'C:\users\asdf' out of 'C:\Users\asdf\foo.txt'
{{ mypath | win_dirname }}
# Get dirname from the UNC path in the form of '\\<SERVER_NAME>\<SHARE_NAME>\<FILENAME.FILE_EXTENSION>'
# like '\\server1\test\foo.txt' returns '\\\\server1\\test\\'
filename: "{{ mypath | win_dirname }}"
RETURN:
_value:
description: The directory from the Windows path provided.

Loading…
Cancel
Save