Skip to main content

UNKNOWN

Project description

Define your per-directory command aliases in Yaml, to get quick shortcuts (and avoid having to remember long commands).

WARNING: This project is still experimental, and things may change suddenly. Suggestions are welcome.

Configuration

Configuration is held in a file, usually named ./.aliases, as a dictionary serialized in YAML format.

The main section is commands, a dict mapping alias names to their specification.

Command specification

  • command: command to be run, as a string

    • will be tokenized via shlex.split

    • string-format-style placeholders will be replaced:

      • positional arguments ({}, {1}) -> variadic arguments to the command

      • ..or explicit: {args[1]}

      • environment: {env[USER]}

      • vars (see below): {vars[USER]}

      • extra arguments will be appended to the command

  • env: environment for the command

    • not considered in string formatting

    • will go through the same formatting as commands

  • vars: to be replaced in env/command formatting

Notes

  • we want some way to prevent automatic appending of varargs

  • we might want to use jinja for formatting, so we can have conditionals / defaults

  • we might want inheritance, rather than having “nested” aliasing

Examples

commands:
  test:
    command: xvfb-run py.test --reuse-db -vvv ./tests/
    env:
      DJANGO_SETTINGS_MODULE: fooproject.settings.testing
      PYTHONPATH: "{env[HOME]}/Projects/fooproject"
commands:
  manage:
    command: python manage.py
    env:
      DJANGO_SETTINGS_MODULE: fooproject.settings.testing
      PYTHONPATH: "{env[HOME]}/Projects/fooproject"
      LOG_LEVEL: DEBUG

  runserver:
    command: aliasfile manage runserver

  migrate:
    command: aliasfile manage migrate

  shell:
    command: aliasfile manage shell

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aliasfile-0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

aliasfile-0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file aliasfile-0.1.tar.gz.

File metadata

  • Download URL: aliasfile-0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aliasfile-0.1.tar.gz
Algorithm Hash digest
SHA256 983360031d0d65072bee8ba8db9d9d609017772d333993929497c81874bbba2c
MD5 031403cb69512e42ff054023a334fe13
BLAKE2b-256 29737f5d577e3935b85acc6458e845ec24329f5c802479b8f2333f49c8e07326

See more details on using hashes here.

File details

Details for the file aliasfile-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aliasfile-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 890ae36fc4f9975de64038b1b283100db5faa52a5479fab9ac6ef69b28c6e493
MD5 ad2f3bedc51b008607088435028c8f24
BLAKE2b-256 c3cf6b837efecc8bb7eb59a175b8a08068288888a6859f1c9cd02a7b6171117e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page