Would it be possible to add a command line option to render the truncated strings as just a count (key-value pairs for objects, array elements for arrays)? For example, here's what jless
currently says with https://api.github.com/repos/PaulJuliusMartinez/jless/commits
:
▽ [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …]
▽ [0]: {sha: "cdcb02038730f0cd3f5ccea594511e3cfb37887a", node_id: "C_kwDOFYWjXtoAKGNkY2IwMjAzODczMGYwY2QzZjVjY2VhNTk0N…", …}
sha: "cdcb02038730f0cd3f5ccea594511e3cfb37887a"
node_id: "C_kwDOFYWjXtoAKGNkY2IwMjAzODczMGYwY2QzZjVjY2VhNTk0NTExZTNjZmIzNzg4N2E"
▷ commit: {author: {…}, committer: {…}, message: "Upgrade arg parsing to clap v3 (#17)\n\nSwitches arg parsing to st…", …}
url: "https://api.github.com/repos/PaulJuliusMartinez/jless/commits/cdcb02038730f0cd3f5ccea594511e3cfb37887a"
html_url: "https://github.com/PaulJuliusMartinez/jless/commit/cdcb02038730f0cd3f5ccea594511e3cfb37887a"
comments_url: "https://api.github.com/repos/PaulJuliusMartinez/jless/commits/cdcb02038730f0cd3f5ccea594511e3cfb37887a/…"
▷ author: {login: "tranzystorek-io", id: 5671049, node_id: "MDQ6VXNlcjU2NzEwNDk=", avatar_url: "https://avatars.gith…", …}
▷ committer: {login: "PaulJuliusMartinez", id: 3301004, node_id: "MDQ6VXNlcjMzMDEwMDQ=", avatar_url: "https://avatar…", …}
▷ parents: [{sha: "619f74697d1c0277b07d685bcd061262010485f2", url: "https://api.github.com/repos/PaulJuliusMartinez…", …}]
▷ [1]: {sha: "619f74697d1c0277b07d685bcd061262010485f2", node_id: "C_kwDOFYWjXtoAKDYxOWY3NDY5N2QxYzAyNzdiMDdkNjg1YmNkM…", …}
▷ [2]: {sha: "ba2e6e7dc7855bf32852bd8a113619e91f016e3d", node_id: "C_kwDOFYWjXtoAKGJhMmU2ZTdkYzc4NTViZjMyODUyYmQ4YTExM…", …}
▷ [3]: {sha: "bf449651685c8709a2669e360bb3902f9f68afbd", node_id: "C_kwDOFYWjXtoAKGJmNDQ5NjUxNjg1Yzg3MDlhMjY2OWUzNjBiY…", …}
▷ [4]: {sha: "b3f21a215a9f3b12156f542cc78f330624d5faf1", node_id: "C_kwDOFYWjXtoAKGIzZjIxYTIxNWE5ZjNiMTIxNTZmNTQyY2M3O…", …}
▷ [5]: {sha: "814ac066ae52ad052f2bc685d358821c00f41fea", node_id: "C_kwDOFYWjXtoAKDgxNGFjMDY2YWU1MmFkMDUyZjJiYzY4NWQzN…", …}
[
{
"sha": "cdcb02038730f0cd3f5ccea594511e3cfb37887a",
"node_id": "C_kwDOFYWjXtoAKGNkY2IwMjAzODczMGYwY2QzZjVjY2VhNTk0NTExZTNjZmIzNzg4N2E",
"commit": { 7 },
"url": "https://api.github.com/repos/PaulJuliusMartinez/jless/commits/cdcb02038730f0cd3f5ccea594511e3cfb37887a",
"html_url": "https://github.com/PaulJuliusMartinez/jless/commit/cdcb02038730f0cd3f5ccea594511e3cfb37887a",
"comments_url": "https://api.github.com/repos/PaulJuliusMartinez/jless/commits/cdcb02038730f0cd3f5ccea594511e3cfb37887a/co
mments",
"author": { 18 },
"committer": { 18 },
"parents": [ 1 ]
},
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
{ 9 },
▽ [ 30 ]
▽ [0]: { 9 }
sha: "cdcb02038730f0cd3f5ccea594511e3cfb37887a"
node_id: "C_kwDOFYWjXtoAKGNkY2IwMjAzODczMGYwY2QzZjVjY2VhNTk0NTExZTNjZmIzNzg4N2E"
▷ commit: { 7 }
url: "https://api.github.com/repos/PaulJuliusMartinez/jless/commits/cdcb02038730f0cd3f5ccea594511e3cfb37887a"
html_url: "https://github.com/PaulJuliusMartinez/jless/commit/cdcb02038730f0cd3f5ccea594511e3cfb37887a"
comments_url: "https://api.github.com/repos/PaulJuliusMartinez/jless/commits/cdcb02038730f0cd3f5ccea594511e3cfb37887a/…"
▷ author: { 18 }
▷ committer: { 18 }
▷ parents: [ 1 ]
▷ [1]: { 9 }
▷ [2]: { 9 }
▷ [3]: { 9 }
▷ [4]: { 9 }
▷ [5]: { 9 }
I'm happy to give this a try if you could point me to a starting place. I know zero rust, but am familiar with lots of other languages. It looks like lineprinter.rs:fill_in_value()
is where these labels are generated, and maybe from there into truncatedstrview.rs
, but I quickly got lost in there.