vrepl: suppress the welcome message, if VQUIET is set (#21941)

This commit is contained in:
Delyan Angelov 2024-07-27 11:34:42 +03:00 committed by GitHub
parent 935ecc3289
commit 1b7b8123ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 0 deletions

View file

@ -9,10 +9,12 @@ on:
paths-ignore:
- '**.yml'
- '!**/docs_ci.yml'
- 'cmd/tools/vrepl.v'
pull_request:
paths-ignore:
- '**.yml'
- '!**/docs_ci.yml'
- 'cmd/tools/vrepl.v'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}

View file

@ -5,6 +5,9 @@ on:
pull_request:
paths-ignore:
- '**.md'
- '**.yml'
- '!**/vinix_ci.yml'
- 'cmd/tools/vrepl.v'
push:
branches:
- master
@ -12,6 +15,7 @@ on:
- '**.md'
- '**.yml'
- '!**/vinix_ci.yml'
- 'cmd/tools/vrepl.v'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}

View file

@ -9,6 +9,7 @@ on:
- '**.out'
- '!**/vup_works.yml'
- '!cmd/tools/vup.v'
- 'cmd/tools/vrepl.v'
pull_request:
paths-ignore:
- '**.md'
@ -17,6 +18,7 @@ on:
- '**.out'
- '!**/vup_works.yml'
- '!cmd/tools/vup.v'
- 'cmd/tools/vrepl.v'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}

View file

@ -41,6 +41,7 @@ mut:
const is_stdin_a_pipe = os.is_atty(0) == 0
const vexe = os.getenv('VEXE')
const vquiet = os.getenv('VQUIET') != ''
const vstartup = os.getenv('VSTARTUP')
const repl_folder = os.join_path(os.vtmp_dir(), 'repl')
@ -345,6 +346,9 @@ fn highlight_repl_command(command string) string {
}
fn print_welcome_screen() {
if vquiet {
return
}
cmd_exit := highlight_repl_command('exit')
cmd_list := highlight_repl_command('list')
cmd_help := highlight_repl_command('help')