Page MenuHomePhabricator

Add "%R" to csprintf(), for printing more readable commands
ClosedPublic

Authored by epriestley on Jan 29 2014, 10:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 14, 5:37 AM
Unknown Object (File)
Wed, Feb 12, 3:39 PM
Unknown Object (File)
Sun, Feb 9, 11:19 AM
Unknown Object (File)
Sun, Feb 9, 11:19 AM
Unknown Object (File)
Sun, Feb 9, 11:18 AM
Unknown Object (File)
Tue, Feb 4, 1:32 AM
Unknown Object (File)
Tue, Jan 28, 6:16 AM
Unknown Object (File)
Tue, Jan 28, 6:16 AM
Subscribers

Details

Summary

Ref T4175. The clone commands we print have quoted arguments, but usually don't need them. Add "%R", which is like "%s" but only adds quotes if they're required. This produces slightly more readable commands in the few cases we're generating commands for users to copy/paste.

Test Plan

Added unit tests. Looked up shell metacharacters to double check my definition.

Diff Detail

Repository
rPHU libphutil
Branch
readesc
Lint
Lint Passed
Unit
Tests Passed