复杂调用的设置别名

复杂调用的设置别名

本文介绍了复杂调用的设置别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为访问我的方案解释器设置别名.我尝试了以下方法:

I'm trying to set an alias for accessing my scheme interpreter. I tried the following:

set-alias scheme '& "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib"'

在调用 scheme 时,我收到以下错误消息:

When calling scheme I get the following error message:

Cannot resolve alias 'scheme' because it refers to term '& "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" -
-library "C:\Program Files (x86)\MIT-GNU Scheme\lib"', which is not recognized as a cmdlet, function, operable program,
 or script file. Verify the term and try again.
At line:1 char:7
+ scheme <<<<
    + CategoryInfo          : ObjectNotFound: (scheme:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : AliasNotResolvedException

调用 &"C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib" 直接工作正常另一方面.

Calling & "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib" directly works fine on the other hand.

推荐答案

别名功能适用于简单的名称别名,不允许使用参数.您需要的是一个函数,例如:

The alias feature is meant for simple name aliases and doesn't allow for arguments. What you need is a function e.g.:

function scheme {
    & "C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe" --library "C:\Program Files (x86)\MIT-GNU Scheme\lib"
}

这篇关于复杂调用的设置别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 05:19