| 1897 | constexpr size_t OPTION_DESC_GAP = 2; |
| 1898 | |
| 1899 | String |
| 1900 | format_option |
| 1901 | ( |
| 1902 | const HelpOptionDetails& o |
| 1903 | ) |
| 1904 | { |
| 1905 | const auto& s = o.s; |
| 1906 | const auto& l = o.l; |
| 1907 | |
| 1908 | String result = " "; |
| 1909 | |
| 1910 | if (!s.empty()) |
| 1911 | { |
| 1912 | result += "-" + toLocalString(s); |
| 1913 | if (!l.empty()) |
| 1914 | { |
| 1915 | result += ","; |
| 1916 | } |
| 1917 | } |
| 1918 | else |
| 1919 | { |
| 1920 | result += " "; |
| 1921 | } |
| 1922 | |
| 1923 | if (!l.empty()) |
| 1924 | { |
| 1925 | result += " --" + toLocalString(l); |
| 1926 | } |
| 1927 | |
| 1928 | auto arg = !o.arg_help.empty() ? toLocalString(o.arg_help) : "arg"; |
| 1929 | |
| 1930 | if (!o.is_boolean) |
| 1931 | { |
| 1932 | if (o.has_implicit) |
| 1933 | { |
| 1934 | result += " [=" + arg + "(=" + toLocalString(o.implicit_value) + ")]"; |
| 1935 | } |
| 1936 | else |
| 1937 | { |
| 1938 | result += " " + arg; |
| 1939 | } |
| 1940 | } |
| 1941 | |
| 1942 | return result; |
| 1943 | } |
| 1944 | |
| 1945 | String |
| 1946 | format_description |
no test coverage detected