Compare commits

...

4 commits

Author SHA1 Message Date
cbf39027c5 ci: bump crystal version
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-09 22:32:22 +01:00
642be92684 chore: add code-preloader config file 2024-01-07 19:46:09 +01:00
f279879ce0 chore: add test & install to Makefile 2024-01-07 19:45:39 +01:00
35a87cd7e0 feat: add basic support for bash completion 2024-01-07 17:47:11 +01:00
4 changed files with 89 additions and 1 deletions

25
.code_preloader.yml Normal file
View file

@ -0,0 +1,25 @@
---
# Example configuration for Code-Preloader
# List of repository paths to preload
# source_list:
# - "path/to/repo1"
# - "path/to/repo2"
# List of patterns to ignore during preloading
ignore_list:
- ^\.git/.*
- ^lib.*
# Path to the output file (if null, output to STDOUT)
output_path: null
prompt:
# Optional: Path to a file containing the prompt header
header_path: null
# Optional: Path to a file containing the prompt footer
footer_path: null
# Optional: Path to a file container a jinja template to structure the prompt
template_path: null

View file

@ -5,7 +5,7 @@ name: default
steps: steps:
- name: build:binary - name: build:binary
image: crystallang/crystal:1.10.1-alpine image: crystallang/crystal:1.11.0-alpine
environment: environment:
PACKAGE_BASENAME: mfm_linux_amd64 PACKAGE_BASENAME: mfm_linux_amd64
volumes: volumes:

View file

@ -3,11 +3,29 @@
# SPDX-FileCopyrightText: 2023 Glenn Y. Rolland <glenux@glenux.net> # SPDX-FileCopyrightText: 2023 Glenn Y. Rolland <glenux@glenux.net>
# Copyright © 2023 Glenn Y. Rolland <glenux@glenux.net> # Copyright © 2023 Glenn Y. Rolland <glenux@glenux.net>
PREFIX=/usr
all: build all: build
prepare:
shards install
build: build:
shards build --error-trace shards build --error-trace
@echo SUCCESS @echo SUCCESS
watch: watch:
watchexec --restart --delay-run 3 -c -e cr make build watchexec --restart --delay-run 3 -c -e cr make build
spec: test
test:
crystal spec --error-trace
install:
install \
-m 755 \
bin/code-preloader \
$(PREFIX)/bin
.PHONY: spec test build all prepare install

45
static/completion.bash Normal file
View file

@ -0,0 +1,45 @@
#!/bin/bash
# mfm Bash completion script
_mfm() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
# Options globales pour 'mfm'
local mfm_global_opts="-c --config -v --verbose -o --open --version -h --help"
# Commandes pour 'mfm'
local mfm_cmds="config mapping completion"
# Options pour 'config' et 'mapping'
local config_opts="init"
local mapping_opts="list create edit mount umount delete"
# Ajouter les options globales à chaque cas
case "${prev}" in
mfm)
COMPREPLY=($(compgen -W "${mfm_cmds} ${mfm_global_opts}" -- ${cur}))
return 0
;;
config)
COMPREPLY=($(compgen -W "${config_opts} ${mfm_global_opts}" -- ${cur}))
return 0
;;
mapping)
COMPREPLY=($(compgen -W "${mapping_opts} ${mfm_global_opts}" -- ${cur}))
return 0
;;
*)
if [[ ${cur} == -* ]]; then
COMPREPLY=($(compgen -W "${mfm_global_opts}" -- ${cur}))
fi
return 0
;;
esac
}
# Appliquer la complétion à la fonction 'mfm'
complete -F _mfm mfm