Commit Graph

1023 Commits

Author SHA1 Message Date
Matthias Clasen
cefbbd6e59 table printer: Report actual width
When we can't shrink all the way to the desired
number of columns, report the actual width we've
achieved.

Closes: #2496
Approved by: matthiasclasen
2019-01-08 01:11:49 +00:00
Matthias Clasen
f4e42ec071 table printer: Be more careful with shrink
Ensure that 0 <= shrink[i] <= widths[i],
to avoid bad situations.

Closes: #2496
Approved by: matthiasclasen
2019-01-08 01:11:49 +00:00
Matthias Clasen
a133041bdd table printer: Don't loop forever
After ellipsizing nicely, we try to spread the extra
shortfall around, but we need to stop when we've
exhausted the available shrinkage and give up.

Some tables are just too wide.

This was showing up as an infinite loop with

flatpak remote-ls --columns=app,opt flathub

Closes: #2496
Approved by: matthiasclasen
2019-01-08 01:11:49 +00:00
Matthias Clasen
ee072c24a4 Improve warning handling a bit
We were printing the full program name as prefix for warnings,
which does not really help with readability. Lets just use
the single-char 'F:' prefix for all messages, regardless of
log level.

Closes: #2472
Approved by: matthiasclasen
2019-01-08 00:40:57 +00:00
Matthias Clasen
2c794c5d82 Don't let g_warnings disrupt us
Some code paths deep inside flatpak-dir.c use
g_warning to report non-fatal errors. This disrupts
our table formatting without showing up visibly
in the output (since it gets wiped out by the next
redraw). Improve things by installing our own
message handler and showing these messages properly
inside our table, like other errors.

Closes: #2472
Approved by: matthiasclasen
2019-01-08 00:40:57 +00:00
Bastien Nocera
b3c785ee09 Add a --installations option
Similar to the --gl-drivers option, print the installation
paths for all system installations, including custom
installations defined in ${sysconfdir}/flatpak/installations.d/

Closes: #2122
Approved by: matthiasclasen
2019-01-08 00:26:17 +00:00
Matthias Clasen
3853ee49bd Add some internal docs
It helps for clarity to write down the expected behavior
of these flags, even if they are not public api.

Closes: #2512
Approved by: matthiasclasen
2019-01-08 00:11:41 +00:00
Matthias Clasen
835b311b61 uninstall: Present the choices clearly
A choice of 1) system 2) system 3) system is not
very useful. Show the refs.

Closes: #2492
Approved by: matthiasclasen
2019-01-07 23:57:09 +00:00
Matthias Clasen
e273bfec5f list, remote-ls: Avoid a stray newline
If we have nothing to print, don't print a stray newline.

Closes: #2461
Approved by: matthiasclasen
2019-01-07 23:10:51 +00:00
Matthias Clasen
8b3bac05f8 info: Don't format size when poking at details
When the -s option is used, it is likely that
the result is getting screenscraped and reparsed.

Make that easier by producing a plain number in
this case.

Closes: #2536
Approved by: mwleeds
2019-01-04 05:50:23 +00:00
Matthias Clasen
4efef1cebd info: Rename a variable for clarity
Closes: #2536
Approved by: mwleeds
2019-01-04 05:50:23 +00:00
Matthias Clasen
d9982d8550 Improve handling of FLATPAK_BUILTIN_FLAG_ONE_DIR
Error out for all combinations of options that specify
more than one installations.

This was showing up e.g. with

flatpak config --installation=extra --system --get languages

Closes: #2511
Approved by: mwleeds
2019-01-03 23:05:31 +00:00
Matthias Clasen
c39ceac02e build-commit-from: Make docs match reality
Move the -s short option from --src-repo to --subject,
as the docs say. This makes more sense, to go with -b
for --body.

Closes: #2527
Approved by: mwleeds
2019-01-03 22:52:51 +00:00
Matthias Clasen
85789dd4ac Tweak the docs for --user/system/--installation
Take out the plurals, and tweak the wording to make
it less misleading.

See: #2509

Closes: #2513
Approved by: mwleeds
2019-01-03 22:38:55 +00:00
Matthias Clasen
d3488af5c7 build-bundle: Reorder options
This is purely cosmetic, but it just does not make
sense to have the --oci option show up in the middle
of gpg-related options.

Closes: #2528
Approved by: mwleeds
2019-01-03 22:22:48 +00:00
Matthias Clasen
cfae583ec4 Reword help output slightly
Consistently use 'application' instead of 'app'
in the main --help output.

Closes: #2519
Approved by: mwleeds
2019-01-03 21:31:31 +00:00
Matthias Clasen
202f3f5939 Make help output fit 80 columns
Shorten the descriptions for --verbose and --ostree-verbose
to fit 80 columns.

Closes: #2519
Approved by: mwleeds
2019-01-03 21:31:31 +00:00
Matthias Clasen
d0d2642512 Align help output
Line up the command descriptions with the option descriptions
that GOptionContext produces, for more visually pleasing output.

Closes: #2519
Approved by: mwleeds
2019-01-03 21:31:31 +00:00
Matthias Clasen
1149d48e4f build-finish: Correct option help
The placeholder for --extension-priority was "0", which is
misleading.

Closes: #2529
Approved by: mwleeds
2019-01-03 21:17:50 +00:00
Matthias Clasen
6877dc4ff7 config: Fix a copy-paste error
The set handler was talking about --get.

Closes: #2531
Approved by: mwleeds
2019-01-03 20:52:46 +00:00
Matthias Clasen
a2e2068f67 Fix a copy-paste error
There was a copy-paste error causing us to show
system bus ownership wrongly in the permission
table, and causing the footnote numbering to be
out of sync.

Closes: #2535
Approved by: mwleeds
2019-01-03 20:51:13 +00:00
Matthias Clasen
57504820d3 Fix an infinite loop
It turns out that --columns=installation,bla was looping
forever, trying to get over the 'all' inside 'installation'.
Don't get stuck there.

It would be good to have unit tests for such internal functions.

Closes: #2463
Approved by: matthiasclasen
2018-12-21 18:36:23 +00:00
Matthias Clasen
ff9aa02d93 table printer: Remote debug spew
Closes: #2462
Approved by: matthiasclasen
2018-12-21 16:51:48 +00:00
Matthias Clasen
a5154d610f Cleaner progress display
With the new solid Unicode progress bar, we no
longer need the [] around it.  Drop it.

Closes: #2453
Approved by: alexlarsson
2018-12-21 08:29:33 +00:00
Matthias Clasen
140fc7e4a6 uninstall: Port to new library api
We can just use the new installation api to find
unused references.

Closes: #2444
Approved by: alexlarsson
2018-12-21 08:19:46 +00:00
Matthias Clasen
6b59406e80 Consistently use Unicode ellipsis
Now that we're moving away from a pure ASCII esthetic,
it looks odd to me to have a mixture of 3 dots and
proper ellipsis, so switch everything over to use
U+2026 instead of 3 dots.

Some minor other formatting and string changes
are included here as well.

Closes: #2454
Approved by: alexlarsson
2018-12-21 08:07:25 +00:00
Matthias Clasen
c2e9dc2832 Hide the cursor while displaying progress
The cursor interferes with our fancy redraw
and progress, so hide it while we are doing that.

Closes: #2455
Approved by: alexlarsson
2018-12-21 08:06:49 +00:00
Alexander Larsson
c9c395c5c9 table-printer: Correctly handle alignment with utf8
We can't use printf alignment, because that aligns on byte count, not
char counts.

Closes: #2451
Approved by: alexlarsson
2018-12-20 17:06:28 +00:00
Alexander Larsson
9d3b1d6990 table-printer: Fix regression crash
printer->rows is now a Row, not a GPtrArray

Closes: #2451
Approved by: alexlarsson
2018-12-20 17:06:28 +00:00
Alexander Larsson
ce13c45ccf list/remote-ls: Move version and branch column ahead of arch
Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Alexander Larsson
b7e06dee2d tables: Add support for ellipsize start and use for app id
I think this makes a lot more sense than ellipsizing in the middle.
Most app ids start with a common prefix after all.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
5b247157a3 list, search: Ellipsize app ids in the middle
This preserves relevant information at the beginning
and the end.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
f3c6e647c1 table printer: Support middle ellipsization
This is sometimes better than ellipsizing at the end.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
5f1822e838 Add a utility to ellipsize a string in the middle
This is sometimes better than ellipsizing at the end.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
9765ceea3d list, search: ellipsize more columns
The application IDs also tend to be long,
so ellipsize that column as well.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
d6c59020a2 Try harder to ellipsize well
Don't shrink all columns by the same amount.
Shrink wider columns more, and avoid ellipsizing
titles.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Matthias Clasen
fb2b9afb59 Save 2 columns by using proper ellipsis
We already assume … for some help output, might
as well use it here, where every column counts.

Closes: #2448
Approved by: alexlarsson
2018-12-20 16:08:44 +00:00
Alexander Larsson
10cbae02ad list: Default to showing installation if multiple dirs searched
Closes: #2450
Approved by: alexlarsson
2018-12-20 15:50:07 +00:00
Alexander Larsson
28514f6fb9 list: Sort table by ref
Closes: #2450
Approved by: alexlarsson
2018-12-20 15:50:07 +00:00
Alexander Larsson
89650f503c table-printer: Add support for sorting rows
Closes: #2450
Approved by: alexlarsson
2018-12-20 15:50:07 +00:00
Matthias Clasen
ca9bd766e6 run: Add a --cwd option
Bubblewrap has a --chdir option to control the directory
that the command is run in. Add an argument for this to
the flatpak_run_app function, update all callers, and add
a --cwd option to flatpak run that uses this new argument.

Closes: #2443
Approved by: alexlarsson
2018-12-20 15:35:23 +00:00
Alexander Larsson
54d3ceb9b8 cli-transaction: Fix up sizing of download column
We need to take the "< " part into consideration when even when counting
the size of string without it, because they align the same. Otherwise
we cause the column to resize and wrap.

Closes: #2449
Approved by: alexlarsson
2018-12-20 12:51:32 +00:00
Alexander Larsson
830a750d20 cli: Limit length of progress bar
This limits the witdh of the progress bar, because it looked really
weird on a wide terminal and kept changing width as the text at the
end (speed, time left, etc) changed.

It is now never more than 20 chars wide, which is fine with the
new increase in fidelity using unicode blocks.

Closes: #2449
Approved by: alexlarsson
2018-12-20 12:51:32 +00:00
Alexander Larsson
4514286596 CLI: Use unicode chars in progress reporting
There are unicode full blocks and 1/8ths horizontal parts of a block, so
we can use this for the progress bar to get a lot more fidelity.

Closes: #2449
Approved by: alexlarsson
2018-12-20 12:51:32 +00:00
Alexander Larsson
0a825c298b Use unicode chars for in-table progress.
We use unicode chars like ✓, ⍻ and ✗ for the checkmark area in the table.
Also use an em-dash instead of minus in the spinner.

Closes: #2449
Approved by: alexlarsson
2018-12-20 12:51:32 +00:00
Alexander Larsson
c4e76f6374 table-printer: Handle utf8 correctly for string widths
We're counting characters, not bytes, so we need g_ut8_strlen() & co.

Closes: #2449
Approved by: alexlarsson
2018-12-20 12:51:32 +00:00
Alexander Larsson
8eb91968ff list: Add arch to default column set
Without this its impossible to tell apart e.g. multiple
runtimes for different arches.

Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:35 +00:00
Alexander Larsson
17a2174644 CLI: Rename Architecture => Arch in list headers
Its really wasteful to have headers much wider than the
items in the column.

Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:35 +00:00
Alexander Larsson
f57c46bf26 info: Move Sdk out of the commit group
Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:35 +00:00
Alexander Larsson
b732716c62 utils: Drop as_app_load_for_deploy()
This is not needed anymore

Closes: #2409
Approved by: alexlarsson
2018-12-19 15:45:35 +00:00