diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-11-09 13:01:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-11-09 13:01:13 +0200 |
commit | cd3758bb328ff425bb06f18c81d3c353b508a336 (patch) | |
tree | ed8a85f7c01fa83852bb6d51e4fc2dd2a268b388 /cli/cli/txt.cxx | |
parent | 9944c0e901d370316fe55fb845ad1c3c6721038d (diff) |
Add --ascii-tree for translating UTF-8 tree(1) output to ASCII
Diffstat (limited to 'cli/cli/txt.cxx')
-rw-r--r-- | cli/cli/txt.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/cli/txt.cxx b/cli/cli/txt.cxx index 16de45a..1e9094d 100644 --- a/cli/cli/txt.cxx +++ b/cli/cli/txt.cxx @@ -164,13 +164,16 @@ namespace // n > 2 - arg string, short string, long string // size_t n (ds.size ()); - const string& d ( + string d ( n == 1 ? (cd_ == cd_short ? first_sentence (ds[0]) : ds[0]) : (n == 2 ? (cd_ == cd_short ? first_sentence (ds[1]) : ds[1]) : ds[cd_ == cd_short ? 1 : 2])); + if (options.ascii_tree ()) + preprocess_ascii_tree (d); + std::set<string> arg_set; if (n > 1 && options.ansi_color ()) translate_arg (ds[0], arg_set); |