cli: avoid passing full NmCli global variable to nm_cli_spawn_pager()

We should not use global variables, and we should minimize the state
that we pass around. Instead of requiring the full NmCli struct in
nm_cli_spawn_pager(), pass only the necessary data.

This reduces our use of global variables.
This commit is contained in:
Thomas Haller
2020-04-02 13:59:53 +02:00
parent 7627173c0e
commit dbf697c759
5 changed files with 20 additions and 12 deletions

View File

@@ -1587,7 +1587,7 @@ print_required_fields (const NmcConfig *nmc_config,
gboolean field_names = of_flags & NMC_OF_FLAG_FIELD_NAMES;
gboolean section_prefix = of_flags & NMC_OF_FLAG_SECTION_PREFIX;
nm_cli_spawn_pager (&nm_cli);
nm_cli_spawn_pager (nmc_config, &nm_cli.pager_data);
/* --- Main header --- */
if ( nmc_config->print_output == NMC_PRINT_PRETTY