poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] .info ios: Do not print the header when no IOS is open.


From: Jose E. Marchesi
Subject: Re: [PATCH] .info ios: Do not print the header when no IOS is open.
Date: Wed, 13 May 2020 00:35:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Egeyar.

    2020-05-12  Egeyar Bagcioglu  <address@hidden>
    
        * libpoke/libpoke.h: Fix comment.
        * poke/pk-ios.c (pk_cmd_info_ios): Do not print
        the header if there are no open IO spaces.
    ---
     libpoke/libpoke.h | 2 +-
     poke/pk-ios.c     | 9 +++++++--
     2 files changed, 8 insertions(+), 3 deletions(-)
    
    diff --git a/libpoke/libpoke.h b/libpoke/libpoke.h
    index b2b8157c..16a1b0dd 100644
    --- a/libpoke/libpoke.h
    +++ b/libpoke/libpoke.h
    @@ -184,7 +184,7 @@ char *pk_ios_completion_function (pk_compiler pkc,
     
     const char *pk_ios_handler (pk_ios ios);
     
    -/* Return the current IO space, or NULL if there are open spaces in
    +/* Return the current IO space, or NULL if there are no open spaces in
        the given poke compiler.  */
     
     pk_ios pk_ios_cur (pk_compiler pkc);
    diff --git a/poke/pk-ios.c b/poke/pk-ios.c
    index ffc8fa2e..54b3a598 100644
    --- a/poke/pk-ios.c
    +++ b/poke/pk-ios.c
    @@ -203,8 +203,13 @@ pk_cmd_info_ios (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
     {
       assert (argc == 0);
     
    -  pk_printf (_("  Id\tMode\tSize\t\tName\n"));
    -  pk_ios_map (poke_compiler, print_info_ios, NULL);
    +  if (pk_ios_cur(poke_compiler))

Please use a space before the (.

    +    {
    +      pk_printf (_("  Id\tMode\tSize\t\tName\n"));
    +      pk_ios_map (poke_compiler, print_info_ios, NULL);
    +    }
    +  else
    +    pk_printf (_("No IOS is currently open.\n"));
     
       return 1;
     }

I like this change.  But currently all the commands that emit tabulated
data are writing the headers even unconditionally...

It would be great if you could expand your patch to cover them all, to
keep consistency in behavior?  There are only a few of them...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]