[
https://issues.apache.org/jira/browse/HADOOP-17585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17300479#comment-17300479
]
Stephen O'Donnell commented on HADOOP-17585:
--------------------------------------------
Frustratingly, if you include a colon character in the Usage text on a line
starting with dash, eg:
{code}
-t Use specified timestamp in format YYYYMMDD:HHMMSS instead of current time
{code}
The logic in FsShell.printInstanceHelp(...) splits the line on the colon and
treats it like a table. I don't really want to get into changing that logic to
handle escape characters, so I have just changed the format of the help out to
this:
{code}
[-touch [-a] [-m] [-t TIMESTAMP (yyyyMMdd:HHmmss) ] [-c] <path> ... :
Updates the access and modification times of the file specified by the <path>
to
the current time. If the file does not exist, then a zero length file is
created
at <path> with current time as the timestamp of that <path>.
-a Change only the access time
-m Change only the modification time
-t TIMESTAMP Use specified timestamp instead of current time
TIMESTAMP format yyyyMMdd:HHmmss
-c Do not create any files
{code}
Placing the timestamp format on a line by itself stops the FsShell splitting on
colon.
> Correct timestamp format in the docs for the touch command
> ----------------------------------------------------------
>
> Key: HADOOP-17585
> URL: https://issues.apache.org/jira/browse/HADOOP-17585
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 3.4.0
> Reporter: Stephen O'Donnell
> Assignee: Stephen O'Donnell
> Priority: Major
> Attachments: HADOOP-17585.001.patch, HADOOP-17585.002.patch
>
>
> The touch command was added by HADOOP-9214, but the usage instructions and
> docs have never aligned with the code.
> The code uses a timestamp format of:
> {code}
> new SimpleDateFormat("yyyyMMdd:HHmmss");
> {code}
> But the docs indicate it should be yyyyMMddHHmmss.
> While I believe the format in the docs is better, tools or applications may
> be relying on the old format now, so I suggest we simply update the docs and
> usage, and improve the error message if the wrong format is used.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]