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
F13267096: D8099.diff
Wed, May 29, 1:10 AM
F13262797: D8099.id.diff
Mon, May 27, 3:52 AM
F13226207: D8099.id.diff
Sun, May 19, 7:38 PM
F13199535: D8099.id18336.diff
Mon, May 13, 3:38 PM
F13199533: D8099.id18322.diff
Mon, May 13, 3:37 PM
F13199462: D8099.id.diff
Mon, May 13, 3:02 PM
F13199426: D8099.diff
Mon, May 13, 2:44 PM
Unknown Object (File)
Apr 29 2024, 1:59 PM
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