CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 235 forks source link

Remove space at the beginning of a message #151

Open kozzza opened 3 years ago

kozzza commented 3 years ago

I've peeked the definition of the question method in PyInquirer prompts in hopes of finding a way to remove the space that proceeds a message:

def get_prompt_tokens(cli):
        tokens = []

        tokens.append((Token.QuestionMark, qmark))
        tokens.append((Token.Question, ' %s ' % message))
        if ic.answered:
            tokens.append((Token.Answer, ' ' + ic.get_selection()[0]))
        else:
            tokens.append((Token.Instruction, ' (Use arrow keys)'))
        return tokens

It seems the space is hardcoded into the question on the 5th line shown here. Is there anyway to get around that? I've already removed the question mark by passing in qmark as an arg into prompt like so:

prompt(prompt_dict, style=self.cli_style, qmark='')

Thank you.