Skip to content

Commit

Permalink
Update README and remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
codyduong committed Apr 11, 2024
1 parent d77640a commit 8843672
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ Install the module from the [PowerShell Gallery](https://www.powershellgallery.c
Install-Module alias-tips -AllowClobber
```

Inside your PowerShell profile
Inside your PowerShell profile, import alias tips.

> [!IMPORTANT]
> alias-tips should be imported after all aliases declared
```powershell
Import-Module alias-tips
Expand All @@ -69,14 +72,17 @@ This will store a hash of all aliased commands to: `$HOME/.alias_tips.hash` . It
| ALIASTIPS_DEBUG | `$false` | Enable to show debug messages when processing commands |
| ALIASTIPS_HASH_PATH | `[System.IO.Path]::Combine("$HOME", '.alias_tips.hash')` | File Path to store results from `Find-AliasTips` |
| ALIASTIPS_MSG | `"Alias tip: {0}"` | Alias hint message for non-virtual terminals |
| ALIASTIPS_MSG_VT | `` `e[033mAlias tip: {0}`em" `` | Alias hint message for virtual terminals |
| ALIASTIPS_MSG_VT | `` `e[033mAlias tip: {0}`em" `` | Alias hint message for virtual terminals* |
| ALIASTIPS_FUNCTION_INTROSPECTION | `$false` | **POTENTIALLY DESTRUCTIVE** [Function Alias Introspection](#function-alias-introspection) |

\* This uses [ANSI Escape Codes](https://en.wikipedia.org/wiki/ANSI_escape_code), for a [table of colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors).
This also means alias-tips supports any other virtual terminal features: blinking/bold/underline/italics.

## How Does This Work

It will attempt to read all functions/aliases set in the current context.

### Example Interactions
### Example Interactions/Limitations

#### Alias
```powershell
Expand All @@ -90,6 +96,8 @@ function grbi {
git rebase -i $args
}
```
> [!NOTE]
> This has a limitation in that alias-tips does not know in this case that -i is equivalent to the --interactive flag.
#### Function Alias Introspection

Expand Down
8 changes: 0 additions & 8 deletions alias-tips/Public/Find-Alias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ function Find-Alias {
$tokens = @()
$ast = [System.Management.Automation.Language.Parser]::ParseInput($Line, [ref]$tokens, [ref]$null)

$fastAlias = Find-AliasCommand ($tokens.Text -join " ")

# fastAlias is not appreciably faster but is definetly less stable, disable for now?
# if (-not [string]::IsNullOrEmpty($fastAlias)) {
# Write-Verbose "Found alias without resorting to parsing"
# return $fastAlias
# }

$queue = [System.Collections.ArrayList]::new()
$extents = @(0, 0)
$offset = 0
Expand Down

0 comments on commit 8843672

Please sign in to comment.