Skip to content

Commit e8f91da

Browse files
committed
Added initial code
Got Set-Location & Get-Item to return sensible responses. Next I'll have to work on the database & weights, etc.
0 parents  commit e8f91da

File tree

10 files changed

+393
-0
lines changed

10 files changed

+393
-0
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
[Dd]ebug/
46+
[Rr]elease/
47+
*_i.c
48+
*_p.c
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.vspscc
63+
.builds
64+
*.dotCover
65+
66+
## TODO: If you have NuGet Package Restore enabled, uncomment this
67+
#packages/
68+
69+
# Visual C++ cache files
70+
ipch/
71+
*.aps
72+
*.ncb
73+
*.opensdf
74+
*.sdf
75+
76+
# Visual Studio profiler
77+
*.psess
78+
*.vsp
79+
80+
# ReSharper is a .NET coding add-in
81+
_ReSharper*
82+
83+
# Installshield output folder
84+
[Ee]xpress
85+
86+
# DocProject is a documentation generator add-in
87+
DocProject/buildhelp/
88+
DocProject/Help/*.HxT
89+
DocProject/Help/*.HxC
90+
DocProject/Help/*.hhc
91+
DocProject/Help/*.hhk
92+
DocProject/Help/*.hhp
93+
DocProject/Help/Html2
94+
DocProject/Help/html
95+
96+
# Click-Once directory
97+
publish
98+
99+
# Others
100+
[Bb]in
101+
[Oo]bj
102+
sql
103+
TestResults
104+
*.Cache
105+
ClientBin
106+
stylecop.*
107+
~$*
108+
*.dbmdl
109+
Generated_Code #added for RIA/Silverlight projects
110+
111+
# Backup & report files from converting an old project file to a newer
112+
# Visual Studio version. Backup files are not needed, because we have git ;-)
113+
_UpgradeReport_Files/
114+
Backup*/
115+
UpgradeLog*.XML
116+
117+
118+
119+
############
120+
## Windows
121+
############
122+
123+
# Windows image file caches
124+
Thumbs.db
125+
126+
# Folder config file
127+
Desktop.ini
128+
129+
130+
#############
131+
## Python
132+
#############
133+
134+
*.py[co]
135+
136+
# Packages
137+
*.egg
138+
*.egg-info
139+
dist
140+
build
141+
eggs
142+
parts
143+
bin
144+
var
145+
sdist
146+
develop-eggs
147+
.installed.cfg
148+
149+
# Installer logs
150+
pip-log.txt
151+
152+
# Unit test / coverage reports
153+
.coverage
154+
.tox
155+
156+
#Translations
157+
*.mo
158+
159+
#Mr Developer
160+
.mr.developer.cfg
161+
162+
# Mac crap
163+
.DS_Store

Jump.Location.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jump.Location", "Jump.Location\Jump.Location.csproj", "{813430AC-0181-4ACB-B731-C5F6578CEC64}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Any CPU = Debug|Any CPU
9+
Release|Any CPU = Release|Any CPU
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{813430AC-0181-4ACB-B731-C5F6578CEC64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{813430AC-0181-4ACB-B731-C5F6578CEC64}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{813430AC-0181-4ACB-B731-C5F6578CEC64}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{813430AC-0181-4ACB-B731-C5F6578CEC64}.Release|Any CPU.Build.0 = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

Jump.Location/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<startup>
4+
5+
<supportedRuntime version="v2.0.50727"/></startup>
6+
</configuration>

Jump.Location/Jump.Location.csproj

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{813430AC-0181-4ACB-B731-C5F6578CEC64}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Jump.Location</RootNamespace>
11+
<AssemblyName>Jump.Location</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<StartupObject />
37+
</PropertyGroup>
38+
<PropertyGroup>
39+
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
40+
</PropertyGroup>
41+
<ItemGroup>
42+
<Reference Include="Microsoft.PowerShell.Commands.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
43+
<SpecificVersion>False</SpecificVersion>
44+
<HintPath>..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\Microsoft.PowerShell.Commands.Management.dll</HintPath>
45+
</Reference>
46+
<Reference Include="System" />
47+
<Reference Include="System.Configuration.Install" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50+
<SpecificVersion>False</SpecificVersion>
51+
<HintPath>..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll</HintPath>
52+
</Reference>
53+
<Reference Include="System.Xml.Linq" />
54+
<Reference Include="System.Data.DataSetExtensions" />
55+
<Reference Include="System.Data" />
56+
<Reference Include="System.Xml" />
57+
</ItemGroup>
58+
<ItemGroup>
59+
<Compile Include="JumpLocationCommand.cs" />
60+
<Compile Include="JumpLocationSnapIn.cs">
61+
<SubType>Component</SubType>
62+
</Compile>
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<None Include="App.config" />
67+
<None Include="debug.psc1">
68+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
69+
</None>
70+
</ItemGroup>
71+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
72+
<PropertyGroup>
73+
<PreBuildEvent>
74+
</PreBuildEvent>
75+
</PropertyGroup>
76+
<PropertyGroup>
77+
<PostBuildEvent>
78+
</PostBuildEvent>
79+
</PropertyGroup>
80+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
81+
Other similar extension points exist, see Microsoft.Common.targets.
82+
<Target Name="BeforeBuild">
83+
</Target>
84+
<Target Name="AfterBuild">
85+
</Target>
86+
-->
87+
</Project>

Jump.Location/JumpLocationCommand.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Linq;
3+
using System.Management.Automation;
4+
using Microsoft.PowerShell.Commands;
5+
6+
namespace Jump.Location
7+
{
8+
[Cmdlet("Jump", "Location")]
9+
public class JumpLocationCommand : PSCmdlet
10+
{
11+
[Parameter(Position = 0)]
12+
public string Directory { get; set; }
13+
14+
protected override void ProcessRecord()
15+
{
16+
var objs = InvokeCommand.InvokeScript(string.Format("Get-Item -Path {0}", Directory));
17+
18+
InvokeCommand.InvokeScript(string.Format("Set-Location {0}", Directory));
19+
}
20+
}
21+
}

Jump.Location/JumpLocationSnapIn.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.ComponentModel;
2+
using System.Management.Automation;
3+
4+
namespace Jump.Location
5+
{
6+
[RunInstaller(true)]
7+
public class JumpLocationSnapIn : PSSnapIn
8+
{
9+
public override string Name
10+
{
11+
get { return "Jump-Location"; }
12+
}
13+
14+
public override string Vendor
15+
{
16+
get { return "Tim Kellogg"; }
17+
}
18+
19+
public override string Description
20+
{
21+
get { return "Like Set-Location but reads your mind"; }
22+
}
23+
}
24+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Jump.Location")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Hewlett-Packard")]
12+
[assembly: AssemblyProduct("Jump.Location")]
13+
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2012")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("f0e2fb34-f28f-4fd9-bbf2-0e58ec55b429")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Jump.Location/debug.psc1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PSConsoleFile ConsoleSchemaVersion="1.0">
3+
<PSVersion>2.0</PSVersion>
4+
<PSSnapIns>
5+
<PSSnapIn Name="Jump-Location" />
6+
</PSSnapIns>
7+
</PSConsoleFile>

0 commit comments

Comments
 (0)