Changeset 9be9c4d in mainline for uspace/app/sbi/src


Ignore:
Timestamp:
2011-07-13T19:54:05Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3e5c48c9
Parents:
026793d
Message:

Shell command and file-name completion.

Location:
uspace/app/sbi/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/input.c

    r026793d r9be9c4d  
    176176int input_get_line(input_t *input, char **line)
    177177{
     178        const char *prompt;
    178179        const char *sp;
    179180        char *dp;
     
    212213                /* Interactive mode */
    213214                if (input->line_no == 0)
    214                         printf("sbi> ");
     215                        prompt = "sbi> ";
    215216                else
    216                         printf("...  ");
     217                        prompt = "...  ";
    217218
    218219                fflush(stdout);
    219                 if (os_input_line(&line_p) != EOK)
     220                if (os_input_line(prompt, &line_p) != EOK)
    220221                        return EIO;
    221222
  • uspace/app/sbi/src/os/helenos.c

    r026793d r9be9c4d  
    210210 * @param ptr   Place to store pointer to new string.
    211211 */
    212 int os_input_line(char **ptr)
     212int os_input_line(const char *prompt, char **ptr)
    213213{
    214214        char *line;
     
    219219                if (tinput == NULL)
    220220                        return EIO;
     221
     222                tinput_set_prompt(tinput, prompt);
    221223        }
    222224
  • uspace/app/sbi/src/os/os.h

    r026793d r9be9c4d  
    3838char *os_chr_to_astr(wchar_t chr);
    3939void os_input_disp_help(void);
    40 int os_input_line(char **ptr);
     40int os_input_line(const char *prompt, char **ptr);
    4141int os_exec(char * const cmd[]);
    4242
  • uspace/app/sbi/src/os/posix.c

    r026793d r9be9c4d  
    193193 * @param ptr   Place to store pointer to new string.
    194194 */
    195 int os_input_line(char **ptr)
    196 {
     195int os_input_line(const char *prompt, char **ptr)
     196{
     197        printf("%s", prompt);
     198
    197199        if (fgets(os_input_buffer, OS_INPUT_BUFFER_SIZE, stdin) == NULL)
    198200                os_input_buffer[0] = '\0';
Note: See TracChangeset for help on using the changeset viewer.