File tree Expand file tree Collapse file tree 6 files changed +22
-17
lines changed Expand file tree Collapse file tree 6 files changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ def sanitize_for_print
55
66 def indent ( offset )
77 return self unless offset > 0
8- split ( " \n " ) . indent ( offset ) . join ( " \n " )
8+ lines . indent ( offset ) . join
99 end
1010
1111 def to_underscore
@@ -24,7 +24,7 @@ def wrap(length = 80)
2424 end
2525
2626 def lint
27- gsub ( /\s +\n /m , "\n \n " ) . lines . reject { |l | l =~ /^\s *##/ } . join ""
27+ gsub ( /\s +\n /m , "\n \n " ) . lines . reject { |l | l =~ /^\s *##/ } . join
2828 end
2929
3030 def remove_front_matter
Original file line number Diff line number Diff line change 1+ = view_marker
2+
3+ > if [[ -n $long_usage ]]; then
4+ > printf "{{ strings[:options] }}\n"
5+ >
6+ = render(:usage_fixed_flags).indent 2
7+ = render(:usage_flags).indent 2 if flags.any?
8+ = render(:usage_args).indent 2 if args.any? or catch_all.help
9+ = render(:usage_environment_variables).indent 2 if environment_variables.any?
10+ = render(:usage_examples).indent 2 if examples
11+ = render(:footer).indent 2 if footer
12+ >
13+ > fi
Original file line number Diff line number Diff line change 4040
4141= render(:usage_commands).indent 2 if commands.any?
4242>
43-
44- > if [[ -n $long_usage ]]; then
45- > printf "{{ strings[:options] }}\n"
46-
47- = render(:usage_fixed_flags).indent 4
48- = render(:usage_flags).indent 4 if flags.any?
49- = render(:usage_args).indent 4 if args.any? or catch_all.help
50- = render(:usage_environment_variables).indent 4 if environment_variables.any?
51- = render(:usage_examples).indent 4 if examples
52- = render(:footer).indent 4 if footer
53-
54- >
55- > fi
43+ = render(:long_usage).indent 2
5644> }
5745>
5846
Original file line number Diff line number Diff line change @@ -15,3 +15,6 @@ if catch_all.help
1515> printf "{{ catch_all.help.wrap(76).indent(4).sanitize_for_print }}\n"
1616> echo
1717end
18+
19+ >
20+
Original file line number Diff line number Diff line change 66environment_variables.each do |env_var|
77= env_var.render :usage
88end
9+
10+ >
Original file line number Diff line number Diff line change 11= view_marker
22
33> printf "{{ strings[:examples] }}\n"
4- >
54
65examples.each do |example|
76> printf "{{ example.wrap(78).indent(2).sanitize_for_print }}\n"
87end
98
109> echo
11- >
10+ >
You can’t perform that action at this time.
0 commit comments