Commit c28df60
committed
unix: Relax escaping in Debug impl on Command
The Debug output of Command is very useful for showing to the user the
command that was executed when something went wrong. This is done for
example by rustc when invoking an external tool like the linker fails.
It is also overly verbose, since everything is quoted, which makes it
harder to read. Instead, we now first check if we're reasonably sure
that an argument is simple enough that using it in the shell wouldn't
need quoting, and then output it without quotes if possible.
Before and example output could look like this:
PATH="/a:/b" "cc" "foo.o" "-target" "arm64-apple-darwin11.0"
Now it looks like this:
PATH=/a:/b cc foo.o -target arm64-apple-darwin11.01 parent e3a918e commit c28df60
File tree
4 files changed
+87
-18
lines changed- library/std/src
- process
- sys/pal/unix/process
- process_common
4 files changed
+87
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | | - | |
| 571 | + | |
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
| 590 | + | |
594 | 591 | | |
595 | 592 | | |
596 | 593 | | |
| |||
609 | 606 | | |
610 | 607 | | |
611 | 608 | | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 609 | + | |
616 | 610 | | |
617 | 611 | | |
618 | 612 | | |
| |||
638 | 632 | | |
639 | 633 | | |
640 | 634 | | |
641 | | - | |
| 635 | + | |
642 | 636 | | |
643 | 637 | | |
644 | 638 | | |
| |||
660 | 654 | | |
661 | 655 | | |
662 | 656 | | |
663 | | - | |
| 657 | + | |
664 | 658 | | |
665 | 659 | | |
666 | 660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
583 | 618 | | |
584 | | - | |
| 619 | + | |
585 | 620 | | |
586 | 621 | | |
587 | 622 | | |
| |||
595 | 630 | | |
596 | 631 | | |
597 | 632 | | |
598 | | - | |
| 633 | + | |
599 | 634 | | |
600 | 635 | | |
601 | 636 | | |
602 | 637 | | |
603 | 638 | | |
604 | 639 | | |
605 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
606 | 646 | | |
607 | 647 | | |
608 | 648 | | |
609 | | - | |
| 649 | + | |
610 | 650 | | |
611 | | - | |
| 651 | + | |
| 652 | + | |
612 | 653 | | |
613 | 654 | | |
614 | | - | |
| 655 | + | |
615 | 656 | | |
616 | 657 | | |
617 | 658 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
0 commit comments